ensure null value are parsed correctly#108
Merged
EnriqueL8 merged 1 commit intoJul 7, 2026
Merged
Conversation
Signed-off-by: Chengxuan Xing <chengxuan.xing@kaleido.io>
EnriqueL8
requested changes
Jul 6, 2026
| // treating an absent payload as JSON null. A success response with "result": null | ||
| // decodes to a nil JSONAny | ||
| func unmarshalRPCResult(data *fftypes.JSONAny, target interface{}) error { | ||
| b := data.Bytes() |
Contributor
There was a problem hiding this comment.
Actually doesn't this nil pointer exception? don't you need to check data != nil ?
Contributor
Author
There was a problem hiding this comment.
That's not needed. Covered by the underlying Bytes() function
EnriqueL8
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As part of https://github.com/hyperledger-firefly/signer/pull/100/changes#diff-2aad17c4690b0c1fa07321da007ac247e464434b5619e1350b48b8a0a63550d6L169 I switched the
CallRPCfunction to use the internal functionsyncRequestTypedfor metrics recording based on http response status.However, this introduced a regression because the safeguarding logic of responses that contain
result: nullis in the wrapper functionSyncRequest. This PR fixes the regression by applying the safeguarding logic in the regressed code path with a test added.Also, refactored out the common logic.