1
0
Эх сурвалжийг харах

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()
Thibaut Courouble 9 жил өмнө
parent
commit
f0ed6af794

+ 2 - 2
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) ->