Closed bugbytesinc closed 7 months ago
In the TypedEventHandler within the Core project, there is a missing edge case where an Error attached to the result is not forwarded for further processing. At this line:
TypedEventHandler
https://github.com/WalletConnect/WalletConnectSharp/blob/60de2c867f67a68feb44bf04fbf456a8d8378f1b/WalletConnectSharp.Core/Models/MessageHandler/TypedEventHandler.cs#L230
we have:
if (rea.Response != null || rea.Error != null) { await _ref.MessageHandler.SendResult<T, TR>(arg2.Id, arg1, rea.Response); }
If the Response is null because the Error is not, the error is not propagated to the, would suggest something like the following instead:
Response
Error
if (rea.Error != null) { await _ref.MessageHandler.SendError<T, TR>(arg2.Id, arg1, rea.Error); } else if (rea.Response != null) { await _ref.MessageHandler.SendResult<T, TR>(arg2.Id, arg1, rea.Response); }
This follows the patterns seen elsewhere in the code.
In the
TypedEventHandler
within the Core project, there is a missing edge case where an Error attached to the result is not forwarded for further processing. At this line:https://github.com/WalletConnect/WalletConnectSharp/blob/60de2c867f67a68feb44bf04fbf456a8d8378f1b/WalletConnectSharp.Core/Models/MessageHandler/TypedEventHandler.cs#L230
we have:
If the
Response
is null because theError
is not, the error is not propagated to the, would suggest something like the following instead:This follows the patterns seen elsewhere in the code.