From: Loic Baron Date: Sat, 4 Oct 2014 09:14:22 +0000 (+0200) Subject: manifold.js : if a record has no key matching the metadata, drop the object instead... X-Git-Tag: myslice-1.2~1^2~17^2~3 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=4be845ba194482e55ecc172ee3495e8126be8555 manifold.js : if a record has no key matching the metadata, drop the object instead of causing a JS error --- diff --git a/manifoldapi/static/js/manifold.js b/manifoldapi/static/js/manifold.js index 74fb5d9d..e2b06cfa 100644 --- a/manifoldapi/static/js/manifold.js +++ b/manifoldapi/static/js/manifold.js @@ -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);