Fix access to undefined root property

The ::filterDefined transform unfortunately doesn't prevent an undefined
initial value when applied to behaviors.
This commit is contained in:
Nathan Sobo
2014-01-09 10:47:07 -07:00
parent 2317c6835e
commit 466868e639

View File

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