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

Do not call node.GetChains() if node is nil #1588

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

msmania
Copy link
Contributor

@msmania msmania commented Dec 21, 2023

In NewSessionNodes, the variable node can be nil if the node is unstaked between sessionCtx and ctx. In such a case, node.GetChains() causes a panic. This patch makes sure we don't call it if the node is nil.
This is a regression from #1582.

Description

Summary generated by Reviewpad on 21 Dec 23 10:23 UTC

This pull request fixes a regression introduced in #1582. The patch ensures that the function node.GetChains() is not called if the node is nil, preventing a panic in the NewSessionNodes function.

In `NewSessionNodes`, the variable `node` can be `nil` if the node
is unstaked between `sessionCtx` and `ctx`.  In such a case,
`node.GetChains()` causes a panic.  This patch makes sure we don't
call it if the `node` is `nil`.
This is a regression from #1582.
@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Dec 21, 2023
@msmania msmania self-assigned this Dec 21, 2023
Copy link
Contributor

@h5law h5law left a comment

Choose a reason for hiding this comment

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

Good catch LGTM

@msmania msmania merged commit 0479a7f into staging Dec 21, 2023
4 of 5 checks passed
@msmania msmania deleted the tokikuch/bugfix-NewSessionNodes branch December 21, 2023 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants