Merge pull request #3107 from taxilian/bug/oldLibraryItemNull

bug: if oldLibraryItem is null things crash
This commit is contained in:
advplyr 2024-06-27 16:36:29 -05:00 committed by GitHub
commit 599623570b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {