diff --git a/server/scanner/LibraryScanner.js b/server/scanner/LibraryScanner.js index 8131300d..6d72e870 100644 --- a/server/scanner/LibraryScanner.js +++ b/server/scanner/LibraryScanner.js @@ -176,9 +176,11 @@ class LibraryScanner { // TODO: Temporary while using old model to socket emit const oldLibraryItem = await Database.libraryItemModel.getOldById(existingLibraryItem.id) - oldLibraryItem.isMissing = true - oldLibraryItem.updatedAt = Date.now() - oldLibraryItemsUpdated.push(oldLibraryItem) + if (oldLibraryItem) { + oldLibraryItem.isMissing = true + oldLibraryItem.updatedAt = Date.now() + oldLibraryItemsUpdated.push(oldLibraryItem) + } } } } else {