From f0ed6af79423f2104fe866ae28639bc395a0c733 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sat, 6 Feb 2016 11:15:18 -0500 Subject: [PATCH] Work around bug where doc list is active but its el has no parent No idea what's going on :/ TypeError: Cannot read property 'removeChild' of null at HTMLDivElement.() at o.app.views.ListFold.o.onClick() at o.app.views.ListFold.o.toggle() at o.app.views.ListFold.o.close() at Function.$.trigger() at HTMLDivElement.() at o.app.views.DocList.o.onClose() at o.app.View.e.detach() at Function.$.remove() --- assets/javascripts/lib/util.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/lib/util.coffee b/assets/javascripts/lib/util.coffee index baf36124..4fd341d6 100644 --- a/assets/javascripts/lib/util.coffee +++ b/assets/javascripts/lib/util.coffee @@ -111,9 +111,9 @@ $.after = (el, value) -> $.remove = (value) -> if $.isCollection(value) - el.parentElement.removeChild(el) for el in $.makeArray(value) + el.parentElement?.removeChild(el) for el in $.makeArray(value) else - value.parentElement.removeChild(value) + value.parentElement?.removeChild(value) return $.empty = (el) ->