mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 13:43:09 +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) {
|
||||
composition.then(function (c) {
|
||||
var nextObject = findObject(c, path[index]);
|
||||
if (index + 1 >= path.length) {
|
||||
navigateTo(nextObject);
|
||||
if (nextObject) {
|
||||
if (index + 1 >= path.length) {
|
||||
navigateTo(nextObject);
|
||||
} else {
|
||||
doNavigate(nextObject, index + 1);
|
||||
}
|
||||
} 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