From dd20823240feca31d9445a1042e4ea93a59f08b8 Mon Sep 17 00:00:00 2001 From: Nicolas Buquet Date: Wed, 18 Jun 2025 13:35:04 +0200 Subject: [PATCH] Make BugReportService `reportUrl` optional (#4195) --- ElementX/Sources/Services/BugReport/BugReportService.swift | 2 +- .../Sources/Services/BugReport/BugReportServiceProtocol.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 {