diff --git a/lib/common/api/crash-reporter.js b/lib/common/api/crash-reporter.js index ca3d33af62f9..ac0c98d8c6e2 100644 --- a/lib/common/api/crash-reporter.js +++ b/lib/common/api/crash-reporter.js @@ -2,6 +2,7 @@ const {spawn} = require('child_process') const electron = require('electron') +const {app} = process.type === 'browser' ? electron : electron.remote const binding = process.atomBinding('crash_reporter') class CrashReporter { @@ -12,7 +13,6 @@ class CrashReporter { this.productName = options.productName let {autoSubmit, companyName, extra, ignoreSystemCrashHandler, submitURL} = options - const app = (process.type === 'browser' ? electron : electron.remote).app this.tempDirectory = app.getPath('temp') if (this.productName == null) { this.productName = app.getName() @@ -66,7 +66,9 @@ class CrashReporter { } getUploadedReports () { - return binding._getUploadedReports(this.productName, this.tempDirectory) + const productName = this.productName != null ? this.productName : app.getName() + const tempDirectory = this.tempDirectory != null ? this.tempDirectory : app.getPath('temp') + return binding._getUploadedReports(productName, tempDirectory) } }