File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/java/graphql/validation/constraints/standard Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,17 @@ public boolean appliesToType(GraphQLInputType inputType) {
45
45
@ Override
46
46
protected List <GraphQLError > runConstraint (ValidationEnvironment validationEnvironment ) {
47
47
Object validatedValue = validationEnvironment .getValidatedValue ();
48
+
49
+ if (validatedValue == null ) {
50
+ return Collections .emptyList ();
51
+ }
52
+
48
53
GraphQLInputType argType = validationEnvironment .getValidatedType ();
49
54
50
55
GraphQLDirective directive = validationEnvironment .getContextObject (GraphQLDirective .class );
51
56
int min = getIntArg (directive , "min" );
52
57
int max = getIntArg (directive , "max" );
53
-
54
-
58
+
55
59
int size = getStringOrIDOrObjectOrMapLength (argType , validatedValue );
56
60
57
61
if (size < min ) {
You can’t perform that action at this time.
0 commit comments