Skip to content

Commit

Permalink
Merge pull request #983 from jeongkyun-oh/KLT-861-fix-receipt-nil-check
Browse files Browse the repository at this point in the history
Added receipt nil check logic
  • Loading branch information
jeongkyun-oh committed May 31, 2021
2 parents 5b416fc + 8e38d0e commit c60011a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion datasync/chaindatafetcher/chaindata_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,12 @@ func (f *ChainDataFetcher) makeChainEvent(blockNumber uint64) (blockchain.ChainE
var logs []*types.Log
block := f.blockchain.GetBlockByNumber(blockNumber)
if block == nil {
return blockchain.ChainEvent{}, fmt.Errorf("GetBlockByNumber is failed. blockNumber: %v", blockNumber)
return blockchain.ChainEvent{}, fmt.Errorf("GetBlockByNumber is failed. blockNumber=%v", blockNumber)
}
receipts := f.blockchain.GetReceiptsByBlockHash(block.Hash())
if receipts == nil {
return blockchain.ChainEvent{}, fmt.Errorf("GetReceiptsByBlockHash is failed. blockNumber=%v", blockNumber)
}
for _, r := range receipts {
logs = append(logs, r.Logs...)
}
Expand Down

0 comments on commit c60011a

Please sign in to comment.