Skip to content

Commit aec7a3d

Browse files
authored
Update tokenizer.lua
Fixed edge case i encounterd
1 parent 240ba87 commit aec7a3d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/prometheus/tokenizer.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ end
7171

7272
function Tokenizer:getPosition(i)
7373
local column = self.columnMap[i]
74+
75+
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.)
76+
column = self.columnMap[#self.columnMap]
77+
end
78+
7479
return column.id, column.charMap[i]
7580
end
7681

0 commit comments

Comments
 (0)