Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Fix Issue#3962 #4442

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/com/alibaba/fastjson/JSONPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -3853,6 +3853,9 @@ protected Object getPropertyValue(Object currentObject, String propertyName, lon
// skip
}
}
if (currentObject == null) {
return null;
}

if (currentObject instanceof Map) {
Map map = (Map) currentObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.alibaba.fastjson.jsonpath.issue3962;

import com.alibaba.fastjson.JSONPath;
import org.junit.Assert;
import org.junit.Test;

public class TestIssue3962 {

@Test
public void testIssue3962() {
Object val = JSONPath.eval("{\"a\": {\"b\": \"\"}}", "$.a.b.c");
Assert.assertNull(val);
}

}