From a9692c7fd0460929788a24c0d2137180ac1b28c2 Mon Sep 17 00:00:00 2001 From: KIRAN KASHALKAR Date: Fri, 24 Feb 2017 12:24:18 +0100 Subject: [PATCH] RIFT-15638, RIFT-15642: Leafref feature bugs Signed-off-by: KIRAN KASHALKAR --- skyquake/plugins/composer/src/src/libraries/utils.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/skyquake/plugins/composer/src/src/libraries/utils.js b/skyquake/plugins/composer/src/src/libraries/utils.js index ee4163cd2..418540fdc 100644 --- a/skyquake/plugins/composer/src/src/libraries/utils.js +++ b/skyquake/plugins/composer/src/src/libraries/utils.js @@ -237,6 +237,10 @@ export default { } else { // contains no predicate objectCopy = objectCopy[fragment]; + if (!objectCopy) { + // contains no value + break; + } } } } @@ -319,9 +323,9 @@ export default { let found = _.find(catalogs[key][subKey], {id: fieldKeyArray[0]}); if (found) { for (let foundKey in found) { - let topLevel = _.find(found[foundKey], {id: fieldKeyArray[1]}); - if (topLevel) { - results = this.getAbsoluteResults(topLevel, pathArray.splice(-i, i)); + // let topLevel = _.find(found[foundKey], {id: fieldKeyArray[1]}); + if (foundKey == fieldKeyArray[1]) { + results = this.getAbsoluteResults(found[foundKey], pathArray.splice(-i, i)); return results; } } -- 2.17.1