-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix_: properly check type casts in activity service #6279
base: develop
Are you sure you want to change the base?
fix_: properly check type casts in activity service #6279
Conversation
} else if err == nil { | ||
recipientsResponse, ok := result.(*GetRecipientsResponse) | ||
if ok { | ||
res = recipientsResponse | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If err == nil
and result
can not be type asserted as * GetRecipientsResponse
then this function will return :
&GetRecipientsResponse{
ErrorCode: ErrorCodeFailed,
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's fine, it's basically the same behavior you get from the other functions, since for some reason you don't have a valid result you can return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dlipicar is there a linter we can apply to prevent this in the future?
Jenkins Builds
|
Closes https://github.com/status-im/least-authority-audit/issues/17
Properly check type cast validity before attempting to access it.