mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-13 12:23:34 +01:00
Fix server crash decoding invalid filter groups
This commit is contained in:
1 parent
aef33df8d3
commit
c654de4630
2 files changed
+12
-2
No files matched your search
@@ -11,7 +11,12 @@ const naturalSort = createNewSortInstance({
|
||||
|
||||
module.exports = {
|
||||
decode(text) {
|
||||
return Buffer.from(decodeURIComponent(text), 'base64').toString()
|
||||
try {
|
||||
return Buffer.from(decodeURIComponent(text), 'base64').toString()
|
||||
} catch (error) {
|
||||
Logger.warn(`[libraryFilters] Failed to decode filter value "${text}": ${error.message}`)
|
||||
return null
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,12 @@ const libraryItemsBookFilters = require('./libraryItemsBookFilters')
|
||||
|
||||
module.exports = {
|
||||
decode(text) {
|
||||
return Buffer.from(decodeURIComponent(text), 'base64').toString()
|
||||
try {
|
||||
return Buffer.from(decodeURIComponent(text), 'base64').toString()
|
||||
} catch (error) {
|
||||
Logger.warn(`[seriesFilters] Failed to decode filter value "${text}": ${error.message}`)
|
||||
return null
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user