mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-10 01:15:06 +02:00
Fix: add extra check for valid names and valid author name #502
This commit is contained in:
parent
2e28c9b06d
commit
7717e57c16
2 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
const Logger = require('../../Logger')
|
||||
const { getId } = require('../../utils/index')
|
||||
|
||||
class Author {
|
||||
|
@ -19,7 +20,7 @@ class Author {
|
|||
construct(author) {
|
||||
this.id = author.id
|
||||
this.asin = author.asin
|
||||
this.name = author.name
|
||||
this.name = author.name || ''
|
||||
this.description = author.description || null
|
||||
this.imagePath = author.imagePath
|
||||
this.relImagePath = author.relImagePath
|
||||
|
@ -81,6 +82,10 @@ class Author {
|
|||
|
||||
checkNameEquals(name) {
|
||||
if (!name) return false
|
||||
if (this.name === null) {
|
||||
Logger.error(`[Author] Author name is null (${this.id})`)
|
||||
return false
|
||||
}
|
||||
return this.name.toLowerCase() == name.toLowerCase().trim()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue