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: nil dereference in GetNodeStatus of cashu backend #968

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

elnosh
Copy link
Contributor

@elnosh elnosh commented Jan 9, 2025

app crashes if tries Get Node Status for cashu backend.

Currently GetNodeStatus returns nil and then it tries to dereference that here https://github.com/getAlby/hub/blob/master/wails/wails_handlers.go#L573 causing it to crash.

Returning an empty object rather than nil.

Copy link
Contributor

@rolznz rolznz left a comment

Choose a reason for hiding this comment

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

utACK

@rolznz
Copy link
Contributor

rolznz commented Jan 10, 2025

Edit: actually there are multiple LNClients which return nil here and the method allows returning nil. I think we should actually check in the wails handler.

if (nodeStatus == nil) {
  return WailsRequestRouterResponse{Body: nil, Error: ""}
}
return WailsRequestRouterResponse{Body: *nodeStatus, Error: ""}

@elnosh
Copy link
Contributor Author

elnosh commented Jan 10, 2025

made change to do nil check in the handler

@rolznz
Copy link
Contributor

rolznz commented Jan 11, 2025

Thanks @elnosh !

@rolznz rolznz merged commit 3ad41aa into getAlby:master Jan 11, 2025
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants