Skip to content

Commit f9776eb

Browse files
committed
Added null checks for required configuration objects
1 parent 81ce627 commit f9776eb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/java/graphql/servlet/GraphQLConfiguration.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,23 @@ private Builder(GraphQLInvocationInputFactory invocationInputFactory) {
8080
}
8181

8282
public Builder with(GraphQLQueryInvoker queryInvoker) {
83-
this.queryInvoker = queryInvoker;
83+
if (queryInvoker != null) {
84+
this.queryInvoker = queryInvoker;
85+
}
8486
return this;
8587
}
8688

8789
public Builder with(GraphQLObjectMapper objectMapper) {
88-
this.objectMapper = objectMapper;
90+
if (objectMapper != null) {
91+
this.objectMapper = objectMapper;
92+
}
8993
return this;
9094
}
9195

9296
public Builder with(List<GraphQLServletListener> listeners) {
93-
this.listeners = Objects.requireNonNull(listeners, "listeners must not be null");
97+
if (listeners != null) {
98+
this.listeners = listeners;
99+
}
94100
return this;
95101
}
96102

0 commit comments

Comments
 (0)