catalog-backend: fix location key check in entity provider delta diff

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-09-25 23:52:00 +02:00
parent f6f75515f1
commit bd3d7012a9
@@ -784,7 +784,10 @@ export class DefaultProcessingDatabase implements ProcessingDatabase {
if (!oldRef) {
// Add any entity that does not exist in the database
toAdd.push(upsertItem);
} else if (oldRef.locationKey !== item.deferred.locationKey) {
} else if (
(oldRef?.locationKey ?? undefined) !==
(item.deferred.locationKey ?? undefined)
) {
// Remove and then re-add any entity that exists, but with a different location key
toRemove.push(item.ref);
toAdd.push(upsertItem);