Skip to content

Commit 214a0ca

Browse files
anttipdgriffon
andauthored
Apply suggestion from @dgriffon
Co-authored-by: David Griffon <dgriffon@jahia.com>
1 parent dd3430e commit 214a0ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/graphql/annotations/dataFetchers/MethodDataFetcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ private Object buildArg(Type p, GraphQLType graphQLType, Object arg) {
165165
Type subType = ((ParameterizedType) p).getActualTypeArguments()[0];
166166
Object val = buildArg(subType, graphQLType, arg);
167167
// add Optional wrapper if needed
168-
if (val != null && ((ParameterizedType) p).getRawType() == Optional.class) {
169-
return Optional.of(val);
168+
if (((ParameterizedType) p).getRawType() == Optional.class) {
169+
return Optional.ofNullable(val);
170170
}
171171
return val;
172172
} else {

0 commit comments

Comments
 (0)