Skip to content

Commit

Permalink
fix panic (#769)
Browse files Browse the repository at this point in the history
* fix panic
  • Loading branch information
nikkolasg committed Nov 11, 2020
1 parent 32b601e commit ddce47d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/drand_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,11 @@ func (d *Drand) StartFollowChain(req *drand.StartFollowRequest, stream drand.Con
d.state.Unlock()
defer func() {
d.state.Lock()
d.syncerCancel()
if d.syncerCancel != nil {
// it can be nil when we recreate a new beacon we cancel it
// see drand.go:newBeacon()
d.syncerCancel()
}
d.syncerCancel = nil
d.state.Unlock()
}()
Expand Down

0 comments on commit ddce47d

Please sign in to comment.