mirror of
https://github.com/nasa/openmct.git
synced 2024-12-30 01:48:51 +00:00
[Addressability] Handle bad paths
Handle paths that cannot be completely followed, WTD-1149.
This commit is contained in:
parent
d7b79b6b69
commit
26fd56a003
@ -103,12 +103,22 @@ define(
|
|||||||
if (composition) {
|
if (composition) {
|
||||||
composition.then(function (c) {
|
composition.then(function (c) {
|
||||||
var nextObject = findObject(c, path[index]);
|
var nextObject = findObject(c, path[index]);
|
||||||
if (index + 1 >= path.length) {
|
if (nextObject) {
|
||||||
navigateTo(nextObject);
|
if (index + 1 >= path.length) {
|
||||||
|
navigateTo(nextObject);
|
||||||
|
} else {
|
||||||
|
doNavigate(nextObject, index + 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
doNavigate(nextObject, index + 1);
|
// Couldn't find the next element of the path
|
||||||
|
// so navigate to the last path object we did find
|
||||||
|
navigateTo(domainObject);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
// Similar to above case; this object has no composition,
|
||||||
|
// so navigate to it instead of subsequent path elements.
|
||||||
|
navigateTo(domainObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user