mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Merge pull request #3313 from mikiher/author-image-path
Update AuthorController to handle invalid image paths and log a warning
This commit is contained in:
commit
1c0d6e9c67
@ -368,12 +368,12 @@ class AuthorController {
|
||||
author
|
||||
} = req
|
||||
|
||||
if (raw) {
|
||||
// any value
|
||||
if (!author.imagePath || !(await fs.pathExists(author.imagePath))) {
|
||||
Logger.warn(`[AuthorController] Author "${author.name}" has invalid imagePath: ${author.imagePath}`)
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
|
||||
if (raw) {
|
||||
return res.sendFile(author.imagePath)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user