From d285845e04c2400d7b46dd19783be94fd221a3c1 Mon Sep 17 00:00:00 2001 From: advplyr Date: Wed, 11 May 2022 17:07:41 -0500 Subject: [PATCH] Fix:Crash when mobile sends invalid library item to sync with session --- server/managers/PlaybackSessionManager.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/managers/PlaybackSessionManager.js b/server/managers/PlaybackSessionManager.js index 02bcdcf7..1c1086ff 100644 --- a/server/managers/PlaybackSessionManager.js +++ b/server/managers/PlaybackSessionManager.js @@ -40,6 +40,10 @@ class PlaybackSessionManager { async syncLocalSessionRequest(user, sessionJson, res) { var libraryItem = this.db.getLibraryItem(sessionJson.libraryItemId) + if (!libraryItem) { + Logger.error(`[PlaybackSessionManager] syncLocalSessionRequest: Library item not found for session "${sessionJson.libraryItemId}"`) + return res.sendStatus(200) + } var session = await this.db.getPlaybackSession(sessionJson.id) if (!session) {