Skip to content

Commit

Permalink
Fix an issue with null values not being returned
Browse files Browse the repository at this point in the history
  • Loading branch information
whitfin committed Mar 3, 2016
1 parent ed3cae9 commit 54dbe7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/zackehh/dotnotes/DotNotes.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public static JsonNode get(JsonNode node, String path) throws ParseException {
// if we've hit a dead end
if (tmp.isMissingNode() || tmp.isNull()) {
// short-circuit
return MissingNode.getInstance();
return tmp;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/zackehh/dotnotes/GetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void getUsingNulledPath() throws Exception {
JsonNode value = DotNotes.get(objectNode, "test.test.test");

assertNotNull(value);
assertTrue(value.isMissingNode());
assertTrue(value.isNull());
}

@Test(expectedExceptions = ParseException.class, expectedExceptionsMessageRegExp = "Unable to parse '123' at character '1', column 1!")
Expand Down

0 comments on commit 54dbe7f

Please sign in to comment.