From 466868e63919d6fabb8d75caca930fd348c1908f Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 9 Jan 2014 10:47:07 -0700 Subject: [PATCH] Fix access to undefined root property The ::filterDefined transform unfortunately doesn't prevent an undefined initial value when applied to behaviors. --- src/pane-container-model.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pane-container-model.coffee b/src/pane-container-model.coffee index d4029886e..10ab34292 100644 --- a/src/pane-container-model.coffee +++ b/src/pane-container-model.coffee @@ -14,9 +14,10 @@ class PaneContainerModel extends Model constructor: -> super - @subscribe @$root.filterDefined(), (root) => - root.parent = this - root.focusContext = @focusContext + @subscribe @$root, (root) => + if root? + root.parent = this + root.focusContext = @focusContext deserializeParams: (params) -> params.root = atom.deserializers.deserialize(params.root)