diff --git a/src/ignite-element.js b/src/ignite-element.js index 2f3ed58..5abb61e 100644 --- a/src/ignite-element.js +++ b/src/ignite-element.js @@ -36,26 +36,28 @@ class IgniteElement extends HTMLElement { createProperties() { var props = this.properties; - var keys = Object.keys(props); - for (var i = 0; i < keys.length; i++) { - let prop = new IgniteProperty(props[keys[i]]); - this[`_${keys[i]}`] = prop; + if (props != null) { + var keys = Object.keys(props); + for (var i = 0; i < keys.length; i++) { + let prop = new IgniteProperty(props[keys[i]]); + this[`_${keys[i]}`] = prop; - ((propName) => { - Object.defineProperty(this, propName, { - get: function () { - if (IgniteRenderingContext.rendering == false) { - return this[`_${propName}`].value; - } else { - return this[`_${propName}`]; + ((propName) => { + Object.defineProperty(this, propName, { + get: function () { + if (IgniteRenderingContext.rendering == false) { + return this[`_${propName}`].value; + } else { + return this[`_${propName}`]; + } + }, + + set: function (value) { + this[`_${propName}`].value = value; } - }, - - set: function (value) { - this[`_${propName}`].value = value; - } - }); - })(keys[i]); + }); + })(keys[i]); + } } } @@ -66,9 +68,11 @@ class IgniteElement extends HTMLElement { resetProperties() { var props = this.properties; - var keys = Object.keys(props); - for (var i = 0; i < keys.length; i++) { - this[keys[i]] = props[keys[i]]; + if (props != null) { + var keys = Object.keys(props); + for (var i = 0; i < keys.length; i++) { + this[keys[i]] = props[keys[i]]; + } } }