diff --git a/state/locality_index.go b/state/locality_index.go index 8d8ef8c4a..933e5a7e2 100644 --- a/state/locality_index.go +++ b/state/locality_index.go @@ -201,7 +201,7 @@ func (li *LocalityIndex) MakeContext() *ctxLocalityIdx { file: li.roFiles.Load(), bm: li.roBmFile.Load(), } - if x.file.src != nil { + if x.file != nil && x.file.src != nil { x.file.src.refcount.Add(1) } return x