Skip to content

Commit f751a83

Browse files
authored
[PM-19408] Fix shortcuts error for App Intents Crashlytics configured twice (#1631)
1 parent 05f2a5a commit f751a83

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Bitwarden/Application/Services/ErrorReporter/CrashlyticsErrorReporter.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ import FirebaseCrashlytics
66
/// An `ErrorReporter` that logs non-fatal errors to Crashlytics for investigation.
77
///
88
final class CrashlyticsErrorReporter: ErrorReporter {
9+
// MARK: Static Properties
10+
11+
/// Shared singleton error reporter to make sure we don't configure Firebase twice, which throws an error.
12+
static let shared = CrashlyticsErrorReporter()
13+
914
// MARK: Properties
1015

1116
/// A list of additional loggers that errors will be logged to.
@@ -24,7 +29,7 @@ final class CrashlyticsErrorReporter: ErrorReporter {
2429

2530
/// Initialize the `CrashlyticsErrorReporter`.
2631
///
27-
init() {
32+
private init() {
2833
FirebaseApp.configure()
2934
}
3035

Bitwarden/Application/Services/ErrorReporter/ErrorReporterFactory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ enum ErrorReporterFactory {
1010
#if DEBUG
1111
OSLogErrorReporter()
1212
#else
13-
CrashlyticsErrorReporter()
13+
CrashlyticsErrorReporter.shared
1414
#endif
1515
}
1616
}

0 commit comments

Comments
 (0)