Skip to content

Commit

Permalink
go/worker/client: Fix nil dereference on early Query
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko authored and peternose committed Oct 18, 2023
1 parent a1e4b8e commit 4e76ff8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .changelog/5403.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/worker/client: Fix nil dereference on early Query
5 changes: 3 additions & 2 deletions go/worker/client/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@ func (n *Node) Query(ctx context.Context, round uint64, method string, args []by
// Fetch the active descriptor so we can get the current message limits.
n.commonNode.CrossNode.Lock()
dsc := n.commonNode.CurrentDescriptor
latestRound := n.commonNode.CurrentBlock.Header.Round
blk := n.commonNode.CurrentBlock
n.commonNode.CrossNode.Unlock()

if dsc == nil {
if dsc == nil || blk == nil {
return nil, api.ErrNoHostedRuntime
}
maxMessages := dsc.Executor.MaxMessages
latestRound := n.commonNode.CurrentBlock.Header.Round

rtInfo, err := hrt.GetInfo(ctx)
if err != nil {
Expand Down

0 comments on commit 4e76ff8

Please sign in to comment.