Fall back to empty document if window state cannot be deserialized

If the telepath serialization version has changed it will return null
from Site::deserializeDocument.
This commit is contained in:
Nathan Sobo
2013-08-28 10:03:40 -06:00
parent 4474212b3e
commit 2921ac856c

View File

@@ -231,7 +231,7 @@ window.atom =
{site, document} = windowState ? {}
if site? and document?
window.site = telepath.Site.deserialize(site)
window.site.deserializeDocument(document)
window.site.deserializeDocument(document) ? window.site.createDocument({})
else
window.site = new telepath.Site(1)
window.site.createDocument({})