Skip to content

Commit d5cf85c

Browse files
authored
Fix App Check crash if there is a config problem (#878)
1 parent 4c82830 commit d5cf85c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

app_check/src/FirebaseAppCheck.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,14 @@ private static void GetTokenFromCSharpMethod(string appName, int key) {
162162
AppCheckUtil.FinishGetTokenCallback(key, "", 0,
163163
(int)AppCheckError.InvalidConfiguration,
164164
"Missing IAppCheckProviderFactory.");
165+
return;
165166
}
166167
FirebaseApp app = FirebaseApp.GetInstance(appName);
167168
if (app == null) {
168169
AppCheckUtil.FinishGetTokenCallback(key, "", 0,
169170
(int)AppCheckError.Unknown,
170171
"Unable to find App with name: " + appName);
172+
return;
171173
}
172174
IAppCheckProvider provider;
173175
if (!providerMap.TryGetValue(app.Name, out provider)) {
@@ -176,6 +178,7 @@ private static void GetTokenFromCSharpMethod(string appName, int key) {
176178
AppCheckUtil.FinishGetTokenCallback(key, "", 0,
177179
(int)AppCheckError.InvalidConfiguration,
178180
"Failed to create IAppCheckProvider for App: " + appName);
181+
return;
179182
}
180183
providerMap[app.Name] = provider;
181184
}

docs/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ Support
7171

7272
Release Notes
7373
-------------
74+
### Upcoming
75+
- Changes
76+
- App Check: Fixed a crash when there are errors creating a provider.
77+
([#877](https://github.com/firebase/firebase-unity-sdk/issues/877))
78+
7479
### 11.5.0
7580
- Changes
7681
- General: Update to Firebase C++ SDK version 11.5.0.

0 commit comments

Comments
 (0)