From d9eba5869833588cf83c4297d7056d300582f0d8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 19 Feb 2013 22:42:17 -0800 Subject: [PATCH] Create default project/root-view if deserialization fails If either fails to deserialize from the persisted state then fall back to the default constructors. This ensures Atom will still start even if the serialization format changes and the previous stored state can no longer be successfully deserialized. --- src/app/window.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/window.coffee b/src/app/window.coffee index 97c0d9486..c3152c7e6 100644 --- a/src/app/window.coffee +++ b/src/app/window.coffee @@ -64,9 +64,8 @@ windowAdditions = if windowState?.project? window.project = deserialize(windowState.project) window.rootView = deserialize(windowState.rootView) - else - window.project = new Project(atom.getPathToOpen()) - window.rootView = new RootView + window.project ?= new Project(atom.getPathToOpen()) + window.rootView ?= new RootView $(rootViewParentSelector).append(rootView) stopApplication: ->