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.
This commit is contained in:
Kevin Sawicki
2013-02-19 22:42:17 -08:00
parent 9c372fa9bf
commit d9eba58698

View File

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