mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-22 08:53:41 +02:00
Fix:Crash when author is set without a name #1934
This commit is contained in:
parent
24b9ac6a68
commit
c2793fe29b
2 changed files with 5 additions and 2 deletions
|
@ -165,7 +165,7 @@ class AuthorController {
|
|||
var q = (req.query.q || '').toLowerCase()
|
||||
if (!q) return res.json([])
|
||||
var limit = (req.query.limit && !isNaN(req.query.limit)) ? Number(req.query.limit) : 25
|
||||
var authors = Database.authors.filter(au => au.name.toLowerCase().includes(q))
|
||||
var authors = Database.authors.filter(au => au.name?.toLowerCase().includes(q))
|
||||
authors = authors.slice(0, limit)
|
||||
res.json({
|
||||
results: authors
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue