Skip to content

Commit

Permalink
Checking for nil genBlk
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentJ-WR committed Feb 4, 2020
1 parent 6d5f694 commit 5f7b5b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions beacon-chain/rpc/beacon/attestations.go
Expand Up @@ -46,6 +46,9 @@ func (bs *Server) ListAttestations(
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not genesis block: %v", err)
}
if genBlk == nil {
return nil, status.Error(codes.Internal, "Could not find genesis block")
}
genesisRoot, err := ssz.HashTreeRoot(genBlk.Block)
if err != nil {
return nil, err
Expand Down
3 changes: 3 additions & 0 deletions beacon-chain/rpc/beacon/blocks.go
Expand Up @@ -139,6 +139,9 @@ func (bs *Server) ListBlocks(
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not retrieve blocks for genesis slot: %v", err)
}
if genBlk == nil {
return nil, status.Error(codes.Internal, "Could not find genesis block")
}
root, err := ssz.HashTreeRoot(genBlk.Block)
if err != nil {
return nil, err
Expand Down

0 comments on commit 5f7b5b3

Please sign in to comment.