mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-28 09:38:56 +01:00
Fix:Crash for invalid payload to update cover endpoint #1644
This commit is contained in:
parent
3dc9416da6
commit
22b8622c67
@ -162,12 +162,12 @@ class LibraryItemController {
|
||||
|
||||
// PATCH: api/items/:id/cover
|
||||
async updateCover(req, res) {
|
||||
var libraryItem = req.libraryItem
|
||||
const libraryItem = req.libraryItem
|
||||
if (!req.body.cover) {
|
||||
return res.status(400).error('Invalid request no cover path')
|
||||
return res.status(400).send('Invalid request no cover path')
|
||||
}
|
||||
|
||||
var validationResult = await this.coverManager.validateCoverPath(req.body.cover, libraryItem)
|
||||
const validationResult = await this.coverManager.validateCoverPath(req.body.cover, libraryItem)
|
||||
if (validationResult.error) {
|
||||
return res.status(500).send(validationResult.error)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user