Null guard AtomWindow instance in window-method ipc handler

Since things are async, I think the window could potentially disappear
before we can handle the message.
This commit is contained in:
Nathan Sobo
2016-09-22 14:14:37 -06:00
parent b7126aff4c
commit 19a4f1ab89

View File

@@ -294,7 +294,7 @@ class AtomApplication
win.emit(command, args...)
@disposable.add ipcHelpers.respondTo 'window-method', (browserWindow, method, args...) =>
@atomWindowForBrowserWindow(browserWindow)[method](args...)
@atomWindowForBrowserWindow(browserWindow)?[method](args...)
@disposable.add ipcHelpers.on ipcMain, 'pick-folder', (event, responseChannel) =>
@promptForPath "folder", (selectedPaths) ->