Skip to content

Commit

Permalink
Merge pull request #3107 from taxilian/bug/oldLibraryItemNull
Browse files Browse the repository at this point in the history
bug: if oldLibraryItem is null things crash
  • Loading branch information
advplyr authored Jun 27, 2024
2 parents 67b4778 + f9e270e commit 5996235
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/scanner/LibraryScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 5996235

Please sign in to comment.