Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Fix panic when writing to map (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismwendt committed Feb 18, 2022
1 parent cde8136 commit f7ea242
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/indexer/indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,10 @@ func (i *Indexer) ensureRangeFor(pos token.Position, obj ObjectLike) (uint64, bo
return rangeID, false
}

if i.ranges[pos.Filename] == nil {
i.ranges[pos.Filename] = map[int]uint64{}
}

rangeID = i.emitter.EmitRange(start, end)
i.ranges[pos.Filename][pos.Offset] = rangeID
return rangeID, true
Expand Down

0 comments on commit f7ea242

Please sign in to comment.