From 586964deceebcffeb903a55350980550eaafe493 Mon Sep 17 00:00:00 2001 From: Tomek Sroka Date: Tue, 21 Aug 2018 12:44:47 -0700 Subject: [PATCH 1/2] 1181 Fix null element in InputValueDefinition#getChildren --- .../graphql/language/InputValueDefinition.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/graphql/language/InputValueDefinition.java b/src/main/java/graphql/language/InputValueDefinition.java index 4169866be7..06700952a7 100644 --- a/src/main/java/graphql/language/InputValueDefinition.java +++ b/src/main/java/graphql/language/InputValueDefinition.java @@ -21,12 +21,12 @@ public class InputValueDefinition extends AbstractNode imp @Internal protected InputValueDefinition(String name, - Type type, - Value defaultValue, - List directives, - Description description, - SourceLocation sourceLocation, - List comments) { + Type type, + Value defaultValue, + List directives, + Description description, + SourceLocation sourceLocation, + List comments) { super(sourceLocation, comments); this.name = name; this.type = type; @@ -81,7 +81,9 @@ public List getDirectives() { public List getChildren() { List result = new ArrayList<>(); result.add(type); - result.add(defaultValue); + if (defaultValue != null) { + result.add(defaultValue); + } result.addAll(directives); return result; } From c80341bc3e0f543dd3b6c81f6c34c092c1ace17e Mon Sep 17 00:00:00 2001 From: Tomek Sroka Date: Wed, 22 Aug 2018 12:04:22 -0700 Subject: [PATCH 2/2] 1181 Fix null element in InputValueDefinition#getChildren --- .../java/graphql/language/InputValueDefinition.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/graphql/language/InputValueDefinition.java b/src/main/java/graphql/language/InputValueDefinition.java index 06700952a7..477e52e029 100644 --- a/src/main/java/graphql/language/InputValueDefinition.java +++ b/src/main/java/graphql/language/InputValueDefinition.java @@ -21,12 +21,12 @@ public class InputValueDefinition extends AbstractNode imp @Internal protected InputValueDefinition(String name, - Type type, - Value defaultValue, - List directives, - Description description, - SourceLocation sourceLocation, - List comments) { + Type type, + Value defaultValue, + List directives, + Description description, + SourceLocation sourceLocation, + List comments) { super(sourceLocation, comments); this.name = name; this.type = type;