Skip to content

Commit

Permalink
fix inexistent contract
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhangTao1596 committed Sep 22, 2021
1 parent 32d9aad commit 334da52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/StateService/StatePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ private ContractState GetHistoricalContractState(MPTTrie<StorageKey, StorageItem
{
const byte prefix = 8;
StorageKey skey = new KeyBuilder(NativeContract.ContractManagement.Id, prefix).Add(script_hash);
return trie[skey]?.GetInteroperable<ContractState>();
return trie.TryGetValue(skey, out var value) ? value.GetInteroperable<ContractState>() : null;
}

[RpcMethod]
Expand Down

0 comments on commit 334da52

Please sign in to comment.