Bug reporter crashes when 'send logs' is disabled. (#1184)

* Bug reporter crashes when 'send logs' is disabled.

* Make sure generated files are cleaned up when uploading the logs fails.
This commit is contained in:
Jorge Martin Espinosa 2023-08-30 12:49:58 +02:00 committed by GitHub
parent cbe9c27880
commit 4a88e3fab6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

1
changelog.d/1168.bugfix Normal file
View file

@ -0,0 +1 @@
Bug reporter crashes when 'send logs' is disabled.

View file

@ -268,12 +268,13 @@ class DefaultBugReporter @Inject constructor(
}
}
if (!uploadedSomeLogs) {
error("Couldn't upload any logs")
}
mBugReportFiles.addAll(gzippedFiles)
if (gzippedFiles.isNotEmpty() && !uploadedSomeLogs) {
serverError = "Couldn't upload any logs, please retry."
return@withContext
}
if (withScreenshot) {
screenshotHolder.getFileUri()
?.toUri()