diff --git a/src/dom_components/model/Components.js b/src/dom_components/model/Components.js index d6b9689f1..f51af7e8a 100644 --- a/src/dom_components/model/Components.js +++ b/src/dom_components/model/Components.js @@ -22,11 +22,17 @@ export default Backbone.Collection.extend({ }, removeChildren(removed, coll, opts = {}) { + // Removing a parent component can cause this function + // to be called with an already removed child element + if (!removed) { + return; + } + const { domc, em } = this; const allByID = domc ? domc.allById() : {}; if (!opts.temporary) { - // Remove the component from the gloabl list + // Remove the component from the global list const id = removed.getId(); const sels = em.get('SelectorManager').getAll(); const rules = em.get('CssComposer').getAll();