manifold.js : if a record has no key matching the metadata, drop the object instead...
[myslice.git] / manifoldapi / static / js / manifold.js
index 59cb4bb..e2b06cf 100644 (file)
@@ -671,7 +671,7 @@ function QueryStore() {
         });
 
         var end = new Date().getTime();
-        console.log("APPLY FILTERS took", end - start, "ms");
+        console.log("APPLY FILTERS [", filters, "] took", end - start, "ms");
 
     }
 
@@ -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);