Skip to content

Commit

Permalink
fixed null pointer exception in search handler
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Aug 30, 2023
1 parent 0ca67fc commit 3b1420b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func SearchAhead(w http.ResponseWriter, r *http.Request) {
if cachedBlock == nil {
cachedBlock = indexer.GetCachedBlockByStateroot(blockHash)
}
if !cachedBlock.IsReady() {
if cachedBlock != nil && !cachedBlock.IsReady() {
cachedBlock = nil
}
if cachedBlock != nil {
Expand Down

0 comments on commit 3b1420b

Please sign in to comment.