Skip to content

Commit

Permalink
fix JSONPath#extract, for issue #1215
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Mar 9, 2023
1 parent abfbbd8 commit 4931f14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ public void accept(JSONReader jsonReader, JSONPath.Context context) {
if (jsonReader.isEnd()) {
return;
}
jsonReader.nextIfMatch(',');
// return object;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.alibaba.fastjson2.issues_1000;

import com.alibaba.fastjson2.JSONPath;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertNull;

public class Issue1215 {
@Test
public void test() {
String str = "{\"x\":{},\"message\":\"1\"}";
assertNull(JSONPath.extract(str, "$.x.y"));
}
}

0 comments on commit 4931f14

Please sign in to comment.