From eb92bad710a1be9edd81d080369a0d380fddaf80 Mon Sep 17 00:00:00 2001 From: mrben1 Date: Sat, 17 Feb 2024 18:09:25 +1300 Subject: [PATCH] Fixed null reference which can occur when using some rpcs when account info is not successfully retrieved. --- Solnet.Metaplex/Metadata Program/Account/MetadataAccount.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Solnet.Metaplex/Metadata Program/Account/MetadataAccount.cs b/Solnet.Metaplex/Metadata Program/Account/MetadataAccount.cs index 319d6be..8e86446 100644 --- a/Solnet.Metaplex/Metadata Program/Account/MetadataAccount.cs +++ b/Solnet.Metaplex/Metadata Program/Account/MetadataAccount.cs @@ -216,7 +216,7 @@ async public static Task GetAccount(IRpcClient client, PublicKe { var accInfoResponse = await client.GetAccountInfoAsync(tokenAddress.Key); - if (accInfoResponse.WasSuccessful) + if (accInfoResponse.WasSuccessful && accInfoResponse.Result.Value != null) { AccountInfo accInfo = accInfoResponse.Result.Value; //Account Inception loop to retrieve metadata