From bf6e8fe27719170568c31243f32478065d38f644 Mon Sep 17 00:00:00 2001 From: Michiel Oliemans Date: Sun, 21 Apr 2019 08:15:12 +0200 Subject: [PATCH] Do not require variables to be non null but initialize empty (fix #168) --- src/main/java/graphql/servlet/internal/GraphQLRequest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/graphql/servlet/internal/GraphQLRequest.java b/src/main/java/graphql/servlet/internal/GraphQLRequest.java index 95493ee8..c7e3e625 100644 --- a/src/main/java/graphql/servlet/internal/GraphQLRequest.java +++ b/src/main/java/graphql/servlet/internal/GraphQLRequest.java @@ -5,7 +5,6 @@ import java.util.HashMap; import java.util.Map; -import java.util.Objects; /** * @author Andrew Potter @@ -41,7 +40,9 @@ public Map getVariables() { } public void setVariables(Map variables) { - this.variables = Objects.requireNonNull(variables); + if (variables != null) { + this.variables = variables; + } } public String getOperationName() {