From 7024e000a81c1e6fb05150da9013a84abadd270e Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 30 Dec 2015 14:32:55 -0500 Subject: [PATCH 1/2] Provide some defaults. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we’ll get: TypeError: Cannot read property 'pathToOpen' of undefined when called from ‘application:new-file’. --- src/browser/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index e720597e3..c8b417386 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -370,7 +370,7 @@ class AtomApplication # :safeMode - Boolean to control the opened window's safe mode. # :profileStartup - Boolean to control creating a profile of the startup time. # :window - {AtomWindow} to open file paths in. - openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup, window}) -> + openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup, window} = {}) -> @openPaths({pathsToOpen: [pathToOpen], pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup, window}) # Public: Opens multiple paths, in existing windows if possible. From 5c14d3e99b795f045bbdbe56cd6b9adc334ca386 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 30 Dec 2015 14:33:23 -0500 Subject: [PATCH 2/2] Don't fail if `event` is undefined. Unclear why this is undefined, but apparently it is. --- src/browser/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index c8b417386..04c2d3824 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -229,7 +229,7 @@ class AtomApplication @openUrl({urlToOpen, @devMode, @safeMode}) app.on 'activate-with-no-open-windows', (event) => - event.preventDefault() + event?.preventDefault() @emit('application:new-window') # A request from the associated render process to open a new render process.