-
Notifications
You must be signed in to change notification settings - Fork 373
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
add nil check of showonly interface value #950
Conversation
helm/data_template.go
Outdated
if showFile != nil { | ||
showFiles = append(showFiles, showFile.(string)) | ||
} |
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.
Something you could also do here is use the type assertion to test this, as if it's nil then trying to assert it as a string will fail:
if s, ok := showFile.(string); ok {
showFiles = append(showFiles, s)
}
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.
This definitely is a much better way to do it. Thanks for the recommendation!
Co-authored-by: Alex Somesan <alex.somesan@gmail.com>
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.
LGTM. Hopefully this does the trick
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
fix a crash when setting
show_only
value to an empty stringFixes #949
Acceptance tests
Release Note
Release note for CHANGELOG:
References
Community Note