From 536395d1993c7486ee676b2be6fa8686b8466b79 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 6 Jul 2018 22:56:58 +0300 Subject: [PATCH] only compare properties which exist for both objects in 'numeric comparer' note: this is attempt to quick-n-dirty workaround weird issue with having colors informaiton inside 'dimensions' in the latest master example: "blue": 0.2367398738861084, "green": 0.08945406973361969, "red": 0.25246158242225647, "x": 0.25246158242225647, "y": 0.08945406973361969, "z": 0.2367398738861084 --- .../resources/qml/hifi/avatarapp/AvatarsModel.qml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/interface/resources/qml/hifi/avatarapp/AvatarsModel.qml b/interface/resources/qml/hifi/avatarapp/AvatarsModel.qml index 3ae1baa0a5..c753d65380 100644 --- a/interface/resources/qml/hifi/avatarapp/AvatarsModel.qml +++ b/interface/resources/qml/hifi/avatarapp/AvatarsModel.qml @@ -121,11 +121,14 @@ ListModel { return false; for(var prop in o1) { - var v1 = o1[prop]; - var v2 = o2[prop]; + if(o1.hasOwnProperty(prop) && o2.hasOwnProperty(prop)) { + var v1 = o1[prop]; + var v2 = o2[prop]; - if(v1 !== v2 && Math.round(v1 * 1000) != Math.round(v2 * 1000)) - return false; + + if(v1 !== v2 && Math.round(v1 * 1000) != Math.round(v2 * 1000)) + return false; + } } return true;