mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 16:49:42 +00:00
Resolves #2776
Adds null checks for telemetry and domain object configuration
This commit is contained in:
@ -45,7 +45,9 @@ export default class TelemetryCriterion extends EventEmitter {
|
|||||||
this.input = telemetryDomainObjectDefinition.input;
|
this.input = telemetryDomainObjectDefinition.input;
|
||||||
this.metadata = telemetryDomainObjectDefinition.metadata;
|
this.metadata = telemetryDomainObjectDefinition.metadata;
|
||||||
this.telemetryObjectIdAsString = undefined;
|
this.telemetryObjectIdAsString = undefined;
|
||||||
this.objectAPI.get(this.objectAPI.makeKeyString(this.telemetry)).then((obj) => this.initialize(obj));
|
if (this.telemetry) {
|
||||||
|
this.objectAPI.get(this.objectAPI.makeKeyString(this.telemetry)).then((obj) => this.initialize(obj));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize(obj) {
|
initialize(obj) {
|
||||||
|
@ -268,15 +268,17 @@ export default {
|
|||||||
this.openmct.contextMenu._showContextMenuForObjectPath(this.currentObjectPath, event.x, event.y, CONTEXT_MENU_ACTIONS);
|
this.openmct.contextMenu._showContextMenuForObjectPath(this.currentObjectPath, event.x, event.y, CONTEXT_MENU_ACTIONS);
|
||||||
},
|
},
|
||||||
initObjectStyles() {
|
initObjectStyles() {
|
||||||
this.styleRuleManager = new StyleRuleManager(this.domainObject.configuration.objectStyles, this.openmct, this.updateStyle.bind(this));
|
if (this.domainObject.configuration) {
|
||||||
|
this.styleRuleManager = new StyleRuleManager(this.domainObject.configuration.objectStyles, this.openmct, this.updateStyle.bind(this));
|
||||||
|
|
||||||
if (this.unlistenStyles) {
|
if (this.unlistenStyles) {
|
||||||
this.unlistenStyles();
|
this.unlistenStyles();
|
||||||
|
}
|
||||||
|
this.unlistenStyles = this.openmct.objects.observe(this.domainObject, 'configuration.objectStyles', (newObjectStyle) => {
|
||||||
|
//Updating object styles in the inspector view will trigger this so that the changes are reflected immediately
|
||||||
|
this.styleRuleManager.updateObjectStyleConfig(newObjectStyle);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this.unlistenStyles = this.openmct.objects.observe(this.domainObject, 'configuration.objectStyles', (newObjectStyle) => {
|
|
||||||
//Updating object styles in the inspector view will trigger this so that the changes are reflected immediately
|
|
||||||
this.styleRuleManager.updateObjectStyleConfig(newObjectStyle);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
updateStyle(styleObj) {
|
updateStyle(styleObj) {
|
||||||
let keys = Object.keys(styleObj);
|
let keys = Object.keys(styleObj);
|
||||||
|
Reference in New Issue
Block a user