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) {
4545 @ Override
4646 protected List <GraphQLError > runConstraint (ValidationEnvironment validationEnvironment ) {
4747 Object validatedValue = validationEnvironment .getValidatedValue ();
48+
49+ if (validatedValue == null ) {
50+ return Collections .emptyList ();
51+ }
52+
4853 GraphQLInputType argType = validationEnvironment .getValidatedType ();
4954
5055 GraphQLDirective directive = validationEnvironment .getContextObject (GraphQLDirective .class );
5156 int min = getIntArg (directive , "min" );
5257 int max = getIntArg (directive , "max" );
53-
54-
58+
5559 int size = getStringOrIDOrObjectOrMapLength (argType , validatedValue );
5660
5761 if (size < min ) {
You can’t perform that action at this time.
0 commit comments