You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/05 08:31:30 UTC

[GitHub] [iceberg] nastra commented on a diff in pull request #5438: Core: Prevent potential NPEs when retrieving JSON fields

nastra commented on code in PR #5438:
URL: https://github.com/apache/iceberg/pull/5438#discussion_r938580233


##########
core/src/main/java/org/apache/iceberg/util/JsonUtil.java:
##########
@@ -98,6 +98,11 @@ public static <T> T parse(String json, FromJson<T> parser) {
     }
   }
 
+  public static JsonNode get(String property, JsonNode node) {
+    Preconditions.checkArgument(node.has(property), "Cannot parse missing object '%s'", property);

Review Comment:
   that's a good point. I updated this to use `hasNonNull`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org