manifold.js : if a record has no key matching the metadata, drop the object instead...
[unfold.git] / manifoldapi / static / js / manifold.js
index 74fb5d9..e2b06cf 100644 (file)
@@ -1223,6 +1223,11 @@ var manifold = {
         }
 
         key = manifold.metadata.get_key(new_object);
+        if (!key){
+            console.log("object type: " + new_object + " has no key");
+            console.log(record);
+            return;
+        }
         record.hashCode = manifold.record_hashcode(key.sort());
         record.equals   = manifold.record_equals(key);