From 43702e0f8e26eed97cc8c9950de409f9401e4373 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 5 Oct 2016 15:39:47 -0700 Subject: [PATCH] Support calling getUploadedReports on unstarted crash reporter --- lib/common/api/crash-reporter.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) } }