mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 15:18:12 +00:00
[Tree] Don't assume context capability is present
Addresses #753 (newly-created objects may not have context, causing errors when these are encountered by TreeNodeView)
This commit is contained in:
@ -81,13 +81,13 @@ define([
|
||||
};
|
||||
|
||||
function getIdPath(domainObject) {
|
||||
var context = domainObject && domainObject.getCapability('context');
|
||||
|
||||
function getId(domainObject) {
|
||||
return domainObject.getId();
|
||||
}
|
||||
|
||||
return domainObject ?
|
||||
domainObject.getCapability('context').getPath().map(getId) :
|
||||
[];
|
||||
return context ? context.getPath().map(getId) : [];
|
||||
}
|
||||
|
||||
TreeNodeView.prototype.value = function (domainObject) {
|
||||
|
Reference in New Issue
Block a user