Skip to content

Commit

Permalink
fixed null pointer exception when calling index page without any bloc…
Browse files Browse the repository at this point in the history
…k (eg. before genesis)
  • Loading branch information
pk910 committed Aug 10, 2023
1 parent 15d5fb7 commit 4e97267
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handlers/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ func buildIndexPageData() (*models.IndexPageData, time.Duration) {
blocksData := services.GlobalBeaconService.GetDbBlocks(uint64(currentSlot), int32(recentBlockCount), false)
for i := 0; i < len(blocksData); i++ {
blockData := blocksData[i]
if blockData == nil {
continue
}
blockStatus := 1
if blockData.Orphaned {
blockStatus = 2
Expand Down

0 comments on commit 4e97267

Please sign in to comment.