Skip to content

Commit

Permalink
nil check (#4822)
Browse files Browse the repository at this point in the history
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
prestonvanloon and prylabs-bulldozer[bot] committed Feb 10, 2020
1 parent 56fcca6 commit 5c14cd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beacon-chain/p2p/peers/status.go
Expand Up @@ -400,7 +400,7 @@ func (p *Status) CurrentEpoch() uint64 {
defer p.lock.RUnlock()
var highestSlot uint64
for _, ps := range p.status {
if ps.chainState.HeadSlot > highestSlot {
if ps != nil && ps.chainState != nil && ps.chainState.HeadSlot > highestSlot {
highestSlot = ps.chainState.HeadSlot
}
}
Expand Down

0 comments on commit 5c14cd6

Please sign in to comment.