From d5cf85c17846a912a2a9e2623b475447a5f253f9 Mon Sep 17 00:00:00 2001 From: a-maurice Date: Wed, 11 Oct 2023 16:55:53 -0700 Subject: [PATCH] Fix App Check crash if there is a config problem (#878) --- app_check/src/FirebaseAppCheck.cs | 3 +++ docs/readme.md | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/app_check/src/FirebaseAppCheck.cs b/app_check/src/FirebaseAppCheck.cs index 7a3bca00..7cfc4457 100644 --- a/app_check/src/FirebaseAppCheck.cs +++ b/app_check/src/FirebaseAppCheck.cs @@ -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)) { @@ -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; } diff --git a/docs/readme.md b/docs/readme.md index 9a86ecd9..4a910025 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -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.