diff --git a/addon/components/masonry-grid/component.js b/addon/components/masonry-grid/component.js index 861f60c..e65e0e0 100644 --- a/addon/components/masonry-grid/component.js +++ b/addon/components/masonry-grid/component.js @@ -58,13 +58,14 @@ export default Component.extend({ didUpdateAttrs(attrsObj) { this._super(...arguments); + if (attrsObj) { + const shouldRebuild = MASONRY_OPTION_KEYS.any((option) => { + return (attrsObj.newAttrs[option] !== attrsObj.oldAttrs[option]); + }); - const shouldRebuild = MASONRY_OPTION_KEYS.any((option) => { - return (attrsObj.newAttrs[option] !== attrsObj.oldAttrs[option]); - }); - - if (shouldRebuild) { - this._destroyMasonry(); + if (shouldRebuild) { + this._destroyMasonry(); + } } },