diff --git a/server/controllers/LibraryController.js b/server/controllers/LibraryController.js index ac23b683f..2972d5068 100644 --- a/server/controllers/LibraryController.js +++ b/server/controllers/LibraryController.js @@ -787,6 +787,10 @@ class LibraryController { if (!series || series.libraryId !== req.library.id) return res.sendStatus(404) const libraryItemsInSeries = await libraryItemsBookFilters.getLibraryItemsForSeries(series, req.user) + if (!libraryItemsInSeries.length) { + Logger.warn(`[LibraryController] User "${req.user.username}" attempted to access series "${series.id}" with no accessible books`) + return res.sendStatus(404) + } const seriesJson = series.toOldJSON() if (include.includes('progress')) {