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

This commit is contained in:
Shelley Vohr 2020-01-06 11:00:27 -05:00 committed by GitHub
parent 7d2c97b671
commit d56f67b7af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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