Browse Source

refactor: throw error for getLastCrashReport if crashReporter not started (#21685)

trop[bot] 5 years ago
parent
commit
37592cdaee
1 changed files with 6 additions and 1 deletions
  1. 6 1
      lib/common/crash-reporter.js

+ 6 - 1
lib/common/crash-reporter.js

@@ -54,7 +54,12 @@ class CrashReporter {
   }
 
   getUploadedReports () {
-    return binding.getUploadedReports(this.getCrashesDirectory())
+    const crashDir = this.getCrashesDirectory()
+    if (!crashDir) {
+      throw new Error('crashReporter has not been started')
+    }
+
+    return binding.getUploadedReports(crashDir)
   }
 
   getCrashesDirectory () {