pokt-network / pocket-core

Official implementation of the Pocket Network Protocol
http://www.pokt.network
MIT License
208 stars 101 forks source link

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

Closed msmania closed 7 months ago

msmania commented 7 months ago

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.