X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Flibraries%2Futils.js;h=bcf56466ceb16678f01867c797e09545a0513644;hp=a182b1a90a4e1fafb6c850a6d27fe863458c6a59;hb=1065d361f1c1b0c4f1334efe736f2e6e940e7035;hpb=0a464389eabb51c9502a112e03b09a53a55b85c9 diff --git a/skyquake/plugins/composer/src/src/libraries/utils.js b/skyquake/plugins/composer/src/src/libraries/utils.js index a182b1a90..bcf56466c 100644 --- a/skyquake/plugins/composer/src/src/libraries/utils.js +++ b/skyquake/plugins/composer/src/src/libraries/utils.js @@ -271,11 +271,11 @@ export default { // Check if relative path or not // TODO: Below works but - // better to convert the pathCopy to absolute/rooted path + // better to convert the pathCopy to absolute/rooted path // and use the absolute module instead if (this.isRelativePath(leafRefPathCopy)) { let i = pathArray.length; - while (pathArray[pathArray.length - i] == '..') { + while ((pathArray[pathArray.length - i] == '..') && fieldKeyArray.length > 1) { fieldKeyArray.splice(-1, 1); if (!isNaN(Number(fieldKeyArray[fieldKeyArray.length - 1]))) { // found a number, so an index. strip it @@ -310,7 +310,7 @@ export default { } } } - } else { + } else { // not supported - too many levels deep ... maybe some day console.log('The relative path is from a node too many levels deep from root. This is not supported at the time'); }