From 478809e0665ced2ee2f77caffea262d025503d38 Mon Sep 17 00:00:00 2001 From: David Sleeckx Date: Fri, 10 Mar 2017 14:48:14 +0100 Subject: [PATCH] Fixed an issue where a service attribute was used instead of the wrapper --- src/Libs/Vidyano/persistent-object.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Libs/Vidyano/persistent-object.ts b/src/Libs/Vidyano/persistent-object.ts index 3ffbf7c1..fb11fe5d 100644 --- a/src/Libs/Vidyano/persistent-object.ts +++ b/src/Libs/Vidyano/persistent-object.ts @@ -343,7 +343,7 @@ let isDirty = false; this.attributes.removeAll(attr => { - if (!result.attributes.some(a => a.id === attr.id)) { + if (!result.attributes.some(serviceAttr => serviceAttr.id === attr.id)) { delete this.attributes[attr.name]; attr.parent = null; changedAttributes.push(attr); @@ -355,7 +355,7 @@ }); this.attributes.forEach(attr => { - let serviceAttr = Enumerable.from(result.attributes).firstOrDefault(a => a.id === attr.id); + let serviceAttr = Enumerable.from(result.attributes).firstOrDefault(serviceAttr => serviceAttr.id === attr.id); if (serviceAttr) { if (!(serviceAttr instanceof PersistentObjectAttribute)) serviceAttr = this._createPersistentObjectAttribute(serviceAttr); @@ -368,8 +368,9 @@ isDirty = true; }); - result.attributes.forEach(attr => { - if (!this.attributes.some(a => a.id === attr.id)) { + result.attributes.forEach(serviceAttr => { + if (!this.attributes.some(a => a.id === serviceAttr.id)) { + const attr = this._createPersistentObjectAttribute(serviceAttr); this.attributes.push(attr); attr.parent = this;