Skip to content

Commit

Permalink
Merge pull request #1 from NougatBitz/NougatBitz-edgecase-fix-1
Browse files Browse the repository at this point in the history
Update tokenizer.lua
  • Loading branch information
NougatBitz authored Aug 17, 2023
2 parents 240ba87 + aec7a3d commit 86e80d0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/prometheus/tokenizer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ end

function Tokenizer:getPosition(i)
local column = self.columnMap[i]

if not column then --// `i` is bigger than self.length, this shouldnt happen, but it did. (Theres probably some error in the tokenizer, cant find it.)
column = self.columnMap[#self.columnMap]
end

return column.id, column.charMap[i]
end

Expand Down

0 comments on commit 86e80d0

Please sign in to comment.