From ffc93747239cd3b04a68d7d0c536c7a08ab0741a Mon Sep 17 00:00:00 2001
From: Daniel <d.hornung@indiscale.com>
Date: Tue, 20 Feb 2024 12:11:54 +0100
Subject: [PATCH] FIX: Better None handling.

---
 src/caoscrawler/crawl.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/caoscrawler/crawl.py b/src/caoscrawler/crawl.py
index 461a41f9..4990aecc 100644
--- a/src/caoscrawler/crawl.py
+++ b/src/caoscrawler/crawl.py
@@ -183,6 +183,11 @@ def _treat_merge_error_of(newrecord, record):
     """
     for this_p in newrecord.properties:
         that_p = record.get_property(this_p.name)
+        if that_p is None:
+            logger.debug(f"Property {this_p.name} does not exist in the second entity. Note that "
+                         "this should not be the reason for the merge conflict.")
+            continue
+
         if (isinstance(this_p.value, db.Entity)
                 and isinstance(that_p.value, db.Entity)):
             if this_p.value.id is not None and that_p.value.id is not None:
-- 
GitLab