jmte
jmte copied to clipboard
Template `${\ }` causes NullPointerException in Lexer.innerNextToken
With template ${\ }
(escaped space), Lexer.innerNextToken throws NullPointerException
java.lang.NullPointerException: Cannot invoke "String.contains(java.lang.CharSequence)" because "variableName" is null
at com.floreysoft.jmte.token.Lexer.innerNextToken(Lexer.java:245)
at com.floreysoft.jmte.token.Lexer.nextToken(Lexer.java:21)
This is because variableName
is null at
if (variableName.contains(" ")) {
return new InvalidToken();
}
... because Util.MINI_PARSER.greedyScan(completeDefaultString, "(", ")")
return an empty List
when completeDefaultString
is "\ "
.
PR with test and fix: https://github.com/DJCordhose/jmte/pull/28
Would you please also consider making a 7.0.2 release? Thank you!
Your PR has been merged and a new release will be published in the next days