dimensions could be undefined.

This commit is contained in:
Cheng Zhao
2013-05-24 16:34:26 +08:00
parent 15baa08ca2
commit 20b53313af

View File

@@ -37,7 +37,7 @@ window.setUpEnvironment = ->
requireStylesheet(nativeStylesheetPath)
dimensions = atom.getWindowState('dimensions')
dimensions = defaultWindowDimensions unless dimensions.width and dimensions.height
dimensions = defaultWindowDimensions unless dimensions?.width and dimensions?.height
window.setDimensions(dimensions)
remote.getCurrentWindow().show()
$(window).on 'unload', -> atom.setWindowState('dimensions', window.getDimensions())