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 variablenode
can benil
if the node is unstaked betweensessionCtx
andctx
. In such a case,node.GetChains()
causes a panic. This patch makes sure we don't call it if thenode
isnil
. 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 thenode
isnil
, preventing a panic in theNewSessionNodes
function.