Adding null check for the properties getter.
This commit is contained in:
parent
7c0dfd9f7f
commit
c7529f1efc
@ -36,6 +36,7 @@ class IgniteElement extends HTMLElement {
|
|||||||
createProperties() {
|
createProperties() {
|
||||||
var props = this.properties;
|
var props = this.properties;
|
||||||
|
|
||||||
|
if (props != null) {
|
||||||
var keys = Object.keys(props);
|
var keys = Object.keys(props);
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
let prop = new IgniteProperty(props[keys[i]]);
|
let prop = new IgniteProperty(props[keys[i]]);
|
||||||
@ -58,6 +59,7 @@ class IgniteElement extends HTMLElement {
|
|||||||
})(keys[i]);
|
})(keys[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the properties for this element back to their original default
|
* Resets the properties for this element back to their original default
|
||||||
@ -66,11 +68,13 @@ class IgniteElement extends HTMLElement {
|
|||||||
resetProperties() {
|
resetProperties() {
|
||||||
var props = this.properties;
|
var props = this.properties;
|
||||||
|
|
||||||
|
if (props != null) {
|
||||||
var keys = Object.keys(props);
|
var keys = Object.keys(props);
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
this[keys[i]] = props[keys[i]];
|
this[keys[i]] = props[keys[i]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setups this ignite element and constructs it's template when
|
* Setups this ignite element and constructs it's template when
|
||||||
|
Loading…
x
Reference in New Issue
Block a user