Skip to content

Commit 7115c61

Browse files
committed
fix detection of trailing comma
1 parent f3ac1a0 commit 7115c61

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,9 @@ private boolean readBracketPropertyToken(PathTokenAppender appender) {
570570
} else if('\\' == c){
571571
inEscape = true;
572572
} else if (c == CLOSE_SQUARE_BRACKET && !inProperty) {
573+
if (lastSignificantWasComma){
574+
fail("Found empty property at index "+readPosition);
575+
}
573576
break;
574577
} else if (c == potentialStringDelimiter) {
575578
if (inProperty && !inEscape) {

0 commit comments

Comments
 (0)