diff --git a/RPCError.cs b/RPCError.cs index 69e6eb7..5454671 100644 --- a/RPCError.cs +++ b/RPCError.cs @@ -43,9 +43,9 @@ public RPCError(RPCErrorCode code) : this(code, GetDefaultErrorMessage(code)) { } - public RPCError(Dictionary errorDict) + public RPCError(Dictionary? errorDict) { - var errorCode = Convert.ToInt32(value: errorDict["code"]); + var errorCode = Convert.ToInt32(value: errorDict["code"].ToString()); var errorMessage = Convert.ToString(errorDict["message"]); var errorData = errorDict.TryGetValue("data", out var value) ? value : null; Code = (RPCErrorCode)errorCode;