From 75cee638bc5037a45db8ff10c0bbb2f805b3e4b6 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 12 Dec 2013 15:56:44 -0800 Subject: [PATCH] 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. --- src/editor-view.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/editor-view.coffee b/src/editor-view.coffee index fb1540d61..67a5d3ce7 100644 --- a/src/editor-view.coffee +++ b/src/editor-view.coffee @@ -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