From 4be845ba194482e55ecc172ee3495e8126be8555 Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Sat, 4 Oct 2014 11:14:22 +0200 Subject: [PATCH] manifold.js : if a record has no key matching the metadata, drop the object instead of causing a JS error --- manifoldapi/static/js/manifold.js | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.43.0