Skip to content

Commit 3059836

Browse files
jeffgamedevjeffgamedev
andauthored
Fix Thirdweb Wallet Disconnect Null Reference (#106)
Co-authored-by: jeffgamedev <jbrooks@gala.games>
1 parent 99e61ec commit 3059836

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Assets/Thirdweb/Core/Scripts/ThirdwebSession.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,14 @@ internal async Task<string> Connect(WalletConnection walletConnection)
112112

113113
internal async Task Disconnect()
114114
{
115-
await ActiveWallet.Disconnect();
115+
if (ActiveWallet != null)
116+
{
117+
await ActiveWallet.Disconnect();
118+
}
119+
else
120+
{
121+
Debug.LogWarning("No active wallet detected, unable to disconnect.");
122+
}
116123
ThirdwebManager.Instance.SDK.session = new ThirdwebSession(Options, ChainId, RPC);
117124
}
118125

0 commit comments

Comments
 (0)