-
Notifications
You must be signed in to change notification settings - Fork 61
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
Avoid panic on nil allocation #1278
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe modification focuses on refining the error handling mechanism within the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (1)
- x/participationrewards/keeper/hooks.go (1 hunks)
Additional comments: 1
x/participationrewards/keeper/hooks.go (1)
- 79-79: The modification to log "nil allocation" without referencing
err.Error()
whenallocation
is nil is a direct response to the issue described. This change effectively prevents a panic that could occur from attempting to dereference a nilerr
. However, it's important to ensure that this logging statement provides enough context for debugging purposes.Consider enhancing the log message to include more context about why the allocation is nil, which could aid in troubleshooting without needing to dive into the code.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1278 +/- ##
=======================================
Coverage 63.26% 63.26%
=======================================
Files 170 170
Lines 11269 11269
=======================================
Hits 7129 7129
Misses 3415 3415
Partials 725 725
Flags with carried forward coverage won't be shown. Click here to find out more.
|
1. Summary
Fixes #1277
Remove reference to err.Error() in log message when no error is present.
2.Type of change
3. Implementation details
Remove reference in log message to err when err is always nil.
Summary by CodeRabbit