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

This commit is contained in:
trop[bot]
2020-01-07 09:15:50 -05:00
committed by Shelley Vohr
parent 64e48ad0e6
commit 37592cdaee

View File

@@ -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 () {