Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
esaulpaugh committed Aug 29, 2024
1 parent d53e39a commit f315f4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/esaulpaugh/headlong/abi/ABIJSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,12 @@ static JsonArray getArray(JsonObject object, String key) {

private static String getString(JsonObject object, String key) {
final JsonElement element = object.get(key);
if (element instanceof JsonPrimitive) {
return element.getAsString();
}
if (isNull(element)) {
return null;
}
if (element.isJsonPrimitive() && ((JsonPrimitive) element).isString()) {
return element.getAsString();
}
throw new IllegalArgumentException(key + " is not a string");
}

Expand Down

0 comments on commit f315f4d

Please sign in to comment.