From 19a4f1ab8909df25e9fafd021829e29eca0425dd Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 22 Sep 2016 14:14:37 -0600 Subject: [PATCH] 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. --- src/main-process/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main-process/atom-application.coffee b/src/main-process/atom-application.coffee index 3c4844a9c..886f31f7f 100644 --- a/src/main-process/atom-application.coffee +++ b/src/main-process/atom-application.coffee @@ -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) ->