소스 검색

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 년 전
부모
커밋
f0ed6af794
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      assets/javascripts/lib/util.coffee

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