From d73965730c77d8391b16675c98593110556f909d Mon Sep 17 00:00:00 2001 From: CounterFire2023 <136581895+CounterFire2023@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:38:38 +0800 Subject: [PATCH] bug fix: remove crash with sign out google --- app/src/com/cege/games/release/MainActivity.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/com/cege/games/release/MainActivity.java b/app/src/com/cege/games/release/MainActivity.java index 27cbc2f..7832d2c 100644 --- a/app/src/com/cege/games/release/MainActivity.java +++ b/app/src/com/cege/games/release/MainActivity.java @@ -287,10 +287,14 @@ public class MainActivity extends UnityPlayerActivity } public void signOutGoogle(String funId) { - mGoogleSignInClient.signOut() - .addOnCompleteListener(this, task -> { - // ... - }); + if (isGooglePlayServicesAvailable()) { + if (mGoogleSignInClient != null) { + mGoogleSignInClient.signOut() + .addOnCompleteListener(this, task -> { + // ... + }); + } + } } private void handleSignInResult(Task completedTask) {