Compare commits

...

2 Commits

Author SHA1 Message Date
AdamKorcz
73d7b285fa
Merge 26a5a3d8b8 into f57de74cfe 2024-09-08 00:30:58 +03:00
Adam Korczynski
26a5a3d8b8 fix out of range panic
Signed-off-by: Adam Korczynski <adam@adalogics.com>
2024-07-23 22:28:05 +01:00

View File

@ -126,7 +126,7 @@ func handleToken(tokens []*token, index int, postProcessedTokens []*token) (toke
if tokenIsOpType(currentToken, createMapOpType) {
log.Debugf("tokenIsOpType: createMapOpType")
// check the previous token is '[', means we are slice, but dont have a first number
if tokens[index-1].TokenType == traverseArrayCollect {
if index > 0 && tokens[index-1].TokenType == traverseArrayCollect {
log.Debugf("previous token is : traverseArrayOpType")
// need to put the number 0 before this token, as that is implied
postProcessedTokens = append(postProcessedTokens, &token{TokenType: operationToken, Operation: createValueOperation(0, "0")})