bug: if oldLibraryItem is null things crash

This commit is contained in:
Richard Bateman 2024-06-27 14:32:14 -06:00
parent 8cadaa57f6
commit f9e270e4be

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 {