From e37bcdd0ac84aafe79a6378dcb5d6463df52cf40 Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:08:00 +0800 Subject: [PATCH] fix: check nil info --- indexer/file_location_cache.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indexer/file_location_cache.go b/indexer/file_location_cache.go index 71c84ad..bbd7797 100644 --- a/indexer/file_location_cache.go +++ b/indexer/file_location_cache.go @@ -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()) @@ -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()