From 3ffc79a122bbaa46d365c92d0757380a04c65947 Mon Sep 17 00:00:00 2001 From: Wouter Hager Date: Fri, 4 Apr 2014 12:41:52 +0200 Subject: [PATCH] check for id in instance for conflict detection Just check if there is a directives.id, otherwise the error will prevent saving if there are links to be resolved. --- facet.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/facet.js b/facet.js index 49949c1..cb8890f 100644 --- a/facet.js +++ b/facet.js @@ -210,12 +210,12 @@ function FacetedStore(store, facetSchema){ directives.id = facetSchema.getId(props); } if(typeof props.save !== "function"){ - try{ - if(needsOldVersion){ + if(directives.id && needsOldVersion){ + try{ instance = this.get(directives.id); } - } - catch(e){ + catch(e){ + } } var self = this; return when(instance, function(instance){