mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Protect from exceptions when attaching editor views w/ dead editors
Addresses #1306 We still need to know why this is happening, so I left an exception in non-release builds. Since the pane system is about to change a lot I think this is good enough for now.
This commit is contained in:
parent
e1d35ed90f
commit
75cee638bc
@ -780,6 +780,14 @@ class EditorView extends View
|
||||
|
||||
afterAttach: (onDom) ->
|
||||
return unless onDom
|
||||
|
||||
# TODO: Remove this guard when we understand why this is happening
|
||||
unless @editor.isAlive()
|
||||
if atom.isReleasedVersion()
|
||||
return
|
||||
else
|
||||
throw new Error("Assertion failure: EditorView is getting attached to a dead editor. Why?")
|
||||
|
||||
@redraw() if @redrawOnReattach
|
||||
return if @attached
|
||||
@attached = true
|
||||
|
Loading…
Reference in New Issue
Block a user