Skip to content
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 for users { * }: check for nil file data before returning path #1819

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

vjeffrey
Copy link
Contributor

fixes #1724

@@ -33,7 +32,7 @@ func (r *mqlPrivatekey) id() (string, error) {
// TODO: use path or hash depending on initialization

file := r.GetFile()
if file.Error != nil {
if file.Error != nil || file.Data == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit confused by this, it implies that the Error and Data might be nil at the same time

if that is the case, we should probably split those two checks, else return "", file.Error might evaluate to "", nil

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, we can return a custom error if file.Data == nil and just let users know that no file is provided

@preslavgerchev preslavgerchev merged commit eb05b57 into main Sep 22, 2023
10 checks passed
@preslavgerchev preslavgerchev deleted the vj/panic-users branch September 22, 2023 10:14
@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic in users resource on macOS with v9
3 participants