mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-03-19 18:08:19 +01:00
Update AuthorController to handle invalid image paths and log a warning
This commit is contained in:
parent
26d2c5a8f0
commit
20a3657063
@ -368,12 +368,12 @@ class AuthorController {
|
|||||||
author
|
author
|
||||||
} = req
|
} = req
|
||||||
|
|
||||||
if (raw) {
|
|
||||||
// any value
|
|
||||||
if (!author.imagePath || !(await fs.pathExists(author.imagePath))) {
|
if (!author.imagePath || !(await fs.pathExists(author.imagePath))) {
|
||||||
|
Logger.warn(`[AuthorController] Author "${author.name}" has invalid imagePath: ${author.imagePath}`)
|
||||||
return res.sendStatus(404)
|
return res.sendStatus(404)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (raw) {
|
||||||
return res.sendFile(author.imagePath)
|
return res.sendFile(author.imagePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user