Skip to content

Commit

Permalink
Resolve null reference errors in RPCError
Browse files Browse the repository at this point in the history
  • Loading branch information
zadockmaloba committed May 2, 2024
1 parent 91aa178 commit 4982dd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RPCError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public RPCError(RPCErrorCode code) : this(code, GetDefaultErrorMessage(code))
{
}

public RPCError(Dictionary<string, object> errorDict)
public RPCError(Dictionary<string, object>? errorDict)
{
var errorCode = Convert.ToInt32(value: errorDict["code"]);
var errorCode = Convert.ToInt32(value: errorDict["code"].ToString());

Check warning on line 48 in RPCError.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 48 in RPCError.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.
var errorMessage = Convert.ToString(errorDict["message"]);
var errorData = errorDict.TryGetValue("data", out var value) ? value : null;
Code = (RPCErrorCode)errorCode;
Expand Down

0 comments on commit 4982dd4

Please sign in to comment.