Add additional check for presence of configuration attribute (#2393)

This commit is contained in:
Andrew Henry 2019-04-29 19:18:27 -07:00 committed by Pegah Sarram
parent 90e9c79e19
commit 2c11eb90d4

View File

@ -177,7 +177,9 @@ define([
return [ return [
{ {
check(domainObject) { check(domainObject) {
return domainObject.type === 'layout' && domainObject.configuration.layout; return domainObject.type === 'layout' &&
domainObject.configuration &&
domainObject.configuration.layout;
}, },
migrate(domainObject) { migrate(domainObject) {
let childObjects = {}; let childObjects = {};
@ -196,7 +198,9 @@ define([
}, },
{ {
check(domainObject) { check(domainObject) {
return domainObject.type === 'telemetry.fixed' && domainObject.configuration['fixed-display']; return domainObject.type === 'telemetry.fixed' &&
domainObject.configuration &&
domainObject.configuration['fixed-display'];
}, },
migrate(domainObject) { migrate(domainObject) {
const DEFAULT_GRID_SIZE = [64, 16]; const DEFAULT_GRID_SIZE = [64, 16];
@ -234,6 +238,7 @@ define([
{ {
check(domainObject) { check(domainObject) {
return domainObject.type === 'table' && return domainObject.type === 'table' &&
domainObject.configuration &&
domainObject.configuration.table; domainObject.configuration.table;
}, },
migrate(domainObject) { migrate(domainObject) {