Adds null checks for telemetry and domain object configuration
This commit is contained in:
Joshi
2020-03-24 15:40:33 -07:00
parent 57a68a24de
commit dc54eef2c9
2 changed files with 12 additions and 8 deletions

View File

@ -45,8 +45,10 @@ export default class TelemetryCriterion extends EventEmitter {
this.input = telemetryDomainObjectDefinition.input;
this.metadata = telemetryDomainObjectDefinition.metadata;
this.telemetryObjectIdAsString = undefined;
if (this.telemetry) {
this.objectAPI.get(this.objectAPI.makeKeyString(this.telemetry)).then((obj) => this.initialize(obj));
}
}
initialize(obj) {
this.telemetryObject = obj;

View File

@ -268,6 +268,7 @@ export default {
this.openmct.contextMenu._showContextMenuForObjectPath(this.currentObjectPath, event.x, event.y, CONTEXT_MENU_ACTIONS);
},
initObjectStyles() {
if (this.domainObject.configuration) {
this.styleRuleManager = new StyleRuleManager(this.domainObject.configuration.objectStyles, this.openmct, this.updateStyle.bind(this));
if (this.unlistenStyles) {
@ -277,6 +278,7 @@ export default {
//Updating object styles in the inspector view will trigger this so that the changes are reflected immediately
this.styleRuleManager.updateObjectStyleConfig(newObjectStyle);
});
}
},
updateStyle(styleObj) {
let keys = Object.keys(styleObj);