Skip to content

Commit

Permalink
Fix App Check crash if there is a config problem (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-maurice authored Oct 11, 2023
1 parent 4c82830 commit d5cf85c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app_check/src/FirebaseAppCheck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,14 @@ private static void GetTokenFromCSharpMethod(string appName, int key) {
AppCheckUtil.FinishGetTokenCallback(key, "", 0,
(int)AppCheckError.InvalidConfiguration,
"Missing IAppCheckProviderFactory.");
return;
}
FirebaseApp app = FirebaseApp.GetInstance(appName);
if (app == null) {
AppCheckUtil.FinishGetTokenCallback(key, "", 0,
(int)AppCheckError.Unknown,
"Unable to find App with name: " + appName);
return;
}
IAppCheckProvider provider;
if (!providerMap.TryGetValue(app.Name, out provider)) {
Expand All @@ -176,6 +178,7 @@ private static void GetTokenFromCSharpMethod(string appName, int key) {
AppCheckUtil.FinishGetTokenCallback(key, "", 0,
(int)AppCheckError.InvalidConfiguration,
"Failed to create IAppCheckProvider for App: " + appName);
return;
}
providerMap[app.Name] = provider;
}
Expand Down
5 changes: 5 additions & 0 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ Support

Release Notes
-------------
### Upcoming
- Changes
- App Check: Fixed a crash when there are errors creating a provider.
([#877](https://github.com/firebase/firebase-unity-sdk/issues/877))

### 11.5.0
- Changes
- General: Update to Firebase C++ SDK version 11.5.0.
Expand Down

0 comments on commit d5cf85c

Please sign in to comment.