Skip to content

Commit

Permalink
fix: check nil info
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniFrenchBread committed Aug 30, 2024
1 parent a569f21 commit e37bcdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions indexer/file_location_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (c *FileLocationCache) GetFileLocations(ctx context.Context, txSeq uint64)
for _, v := range trusted {
start := time.Now()
fileInfo, err := v.GetFileInfoByTxSeq(ctx, txSeq)
if err != nil || !fileInfo.Finalized {
if err != nil || fileInfo == nil || !fileInfo.Finalized {
continue
}
config, err := v.GetShardConfig(context.Background())
Expand Down Expand Up @@ -123,7 +123,7 @@ func (c *FileLocationCache) GetFileLocations(ctx context.Context, txSeq uint64)
c.latestFailedCall.Store(url, time.Now())
continue
}
if !fileInfo.Finalized {
if fileInfo == nil || !fileInfo.Finalized {
continue
}
start := time.Now()
Expand Down

0 comments on commit e37bcdd

Please sign in to comment.