Skip to content

Commit f0ed6af

Browse files
committed
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.<anonymous>() 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.<anonymous>() at o.app.views.DocList.o.onClose() at o.app.View.e.detach() at Function.$.remove()
1 parent bc0e326 commit f0ed6af

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

assets/javascripts/lib/util.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ $.after = (el, value) ->
111111

112112
$.remove = (value) ->
113113
if $.isCollection(value)
114-
el.parentElement.removeChild(el) for el in $.makeArray(value)
114+
el.parentElement?.removeChild(el) for el in $.makeArray(value)
115115
else
116-
value.parentElement.removeChild(value)
116+
value.parentElement?.removeChild(value)
117117
return
118118

119119
$.empty = (el) ->

0 commit comments

Comments
 (0)