diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java b/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java index 9e2db4bb..4d003dc7 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java @@ -570,6 +570,9 @@ public class PathCompiler { } else if('\\' == c){ inEscape = true; } else if (c == CLOSE_SQUARE_BRACKET && !inProperty) { + if (lastSignificantWasComma){ + fail("Found empty property at index "+readPosition); + } break; } else if (c == potentialStringDelimiter) { if (inProperty && !inEscape) {