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=be55d238f0948b77c11b1c41d68c219a93fce07c;hp=ee4163cd2da264e5c963768f3828aa10af333d32;hb=6620bca06b9874e68e8bc11ce28b7a6eeda5cc03;hpb=625a4c2118c4d095daf2a264643798eddf4d0491 diff --git a/skyquake/plugins/composer/src/src/libraries/utils.js b/skyquake/plugins/composer/src/src/libraries/utils.js index ee4163cd2..be55d238f 100644 --- a/skyquake/plugins/composer/src/src/libraries/utils.js +++ b/skyquake/plugins/composer/src/src/libraries/utils.js @@ -289,11 +289,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 @@ -328,7 +328,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'); }