diff --git a/ElementX/Sources/Services/BugReport/BugReportService.swift b/ElementX/Sources/Services/BugReport/BugReportService.swift index 0ecd995e6..d7ce70de7 100644 --- a/ElementX/Sources/Services/BugReport/BugReportService.swift +++ b/ElementX/Sources/Services/BugReport/BugReportService.swift @@ -140,7 +140,7 @@ class BugReportService: NSObject, BugReportServiceProtocol { decoder.keyDecodingStrategy = .convertFromSnakeCase let uploadResponse = try decoder.decode(SubmitBugReportResponse.self, from: data) - if !uploadResponse.reportUrl.isEmpty { + if !(uploadResponse.reportUrl?.isEmpty ?? false) { lastCrashEventID = nil } diff --git a/ElementX/Sources/Services/BugReport/BugReportServiceProtocol.swift b/ElementX/Sources/Services/BugReport/BugReportServiceProtocol.swift index 190fc9b67..ebe107b3c 100644 --- a/ElementX/Sources/Services/BugReport/BugReportServiceProtocol.swift +++ b/ElementX/Sources/Services/BugReport/BugReportServiceProtocol.swift @@ -22,7 +22,7 @@ struct BugReport: Equatable { } struct SubmitBugReportResponse: Decodable { - var reportUrl: String + var reportUrl: String? } enum BugReportServiceError: LocalizedError {