diff --git a/src/app/window.coffee b/src/app/window.coffee index 93f748833..9d7e23667 100644 --- a/src/app/window.coffee +++ b/src/app/window.coffee @@ -41,7 +41,7 @@ windowAdditions = # Note: RootView assigns itself on window on initialization so that # window.rootView is available when loading user configuration attachRootView: (pathToOpen) -> - if rootViewState = atom.rootViewStates[$windowNumber] + if rootViewState = atom.rootViewStates?[$windowNumber] RootView.deserialize(JSON.parse(rootViewState)) else new RootView(pathToOpen) diff --git a/src/window-bootstrap.coffee b/src/window-bootstrap.coffee index cd8207efe..d1286fa4e 100644 --- a/src/window-bootstrap.coffee +++ b/src/window-bootstrap.coffee @@ -1,4 +1,6 @@ # Like sands through the hourglass, so are the days of our lives. require 'window' +Atom = require 'atom' +window.atom = new Atom(atom.loadPath, $native) window.startup $pathToOpen