From bd3d7012a97069124378b6879ef56c0bb23a59b6 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sun, 25 Sep 2022 23:52:00 +0200 Subject: [PATCH] catalog-backend: fix location key check in entity provider delta diff Signed-off-by: Patrik Oldsberg --- .../src/database/DefaultProcessingDatabase.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-backend/src/database/DefaultProcessingDatabase.ts b/plugins/catalog-backend/src/database/DefaultProcessingDatabase.ts index f6fc7fa5fa..3dc5325178 100644 --- a/plugins/catalog-backend/src/database/DefaultProcessingDatabase.ts +++ b/plugins/catalog-backend/src/database/DefaultProcessingDatabase.ts @@ -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);