Skip to content

Commit

Permalink
update jacoco and kill silly npe
Browse files Browse the repository at this point in the history
  • Loading branch information
ryber committed May 23, 2022
1 parent 5efa6d3 commit 94e3266
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
<version>0.8.8</version>
<executions>
<execution>
<id>default-prepare-agent</id>
Expand Down
2 changes: 1 addition & 1 deletion unirest/src/main/java/kong/unirest/json/JSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static Writer quote(String s, Writer writer) throws IOException {
* @return a object
*/
public static Object stringToValue(String str) {
if(str.contentEquals("null")){
if(str == null || str.contentEquals("null")){
return NULL;
} else if (str.equalsIgnoreCase("true")){
return true;
Expand Down
2 changes: 0 additions & 2 deletions unirest/src/test/java/kong/unirest/json/JSONObjectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,6 @@ void stringToValue() {
assertEquals(42, JSONObject.stringToValue("42"));
assertEquals(45.25, JSONObject.stringToValue("45.25"));
assertEquals(-45.25, JSONObject.stringToValue("-45.25"));
NullPointerException ex = assertThrows(NullPointerException.class, () -> JSONObject.stringToValue(null));
assertEquals(null, ex.getMessage());
}

@Test
Expand Down

0 comments on commit 94e3266

Please sign in to comment.