Skip to content

Commit 586964d

Browse files
author
Tomek Sroka
committed
1181 Fix null element in InputValueDefinition#getChildren
1 parent 0adc5f8 commit 586964d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/main/java/graphql/language/InputValueDefinition.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public class InputValueDefinition extends AbstractNode<InputValueDefinition> imp
2121

2222
@Internal
2323
protected InputValueDefinition(String name,
24-
Type type,
25-
Value defaultValue,
26-
List<Directive> directives,
27-
Description description,
28-
SourceLocation sourceLocation,
29-
List<Comment> comments) {
24+
Type type,
25+
Value defaultValue,
26+
List<Directive> directives,
27+
Description description,
28+
SourceLocation sourceLocation,
29+
List<Comment> comments) {
3030
super(sourceLocation, comments);
3131
this.name = name;
3232
this.type = type;
@@ -81,7 +81,9 @@ public List<Directive> getDirectives() {
8181
public List<Node> getChildren() {
8282
List<Node> result = new ArrayList<>();
8383
result.add(type);
84-
result.add(defaultValue);
84+
if (defaultValue != null) {
85+
result.add(defaultValue);
86+
}
8587
result.addAll(directives);
8688
return result;
8789
}

0 commit comments

Comments
 (0)