Skip to content

Commit 2f32ad9

Browse files
authored
Nikola/fix tests (#1152)
Fixing one batch of tests
1 parent a254e7b commit 2f32ad9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/ChainSafe.Gaming/Web3/Evm/JsonRpc/RpcClientProvider.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@ public async Task<T> Perform<T>(string method, params object[] parameters)
3232
{
3333
var request = new RpcRequestMessage(Guid.NewGuid().ToString(), method, parameters);
3434
response = await SendAsync(request);
35+
36+
// Check if response.Result is null
37+
if (response.Result == null)
38+
{
39+
throw new Web3Exception($"RPC method \"{method}\" returned a null result.");
40+
}
3541
}
3642
catch (Exception ex)
3743
{
38-
throw new Web3Exception($"RPC method \"{method}\" threw an exception:" + response?.Error.Message, ex);
44+
throw new Web3Exception($"RPC method \"{method}\" threw an exception:" + response?.Error?.Message, ex);
3945
}
4046
finally
4147
{

0 commit comments

Comments
 (0)