Skip to content

Commit b282721

Browse files
committed
Handle null cases
1 parent ae5b86f commit b282721

File tree

1 file changed

+6
-2
lines changed
  • graphql-dxm-provider/src/main/java/org/jahia/modules/graphql/provider/dxm/sdl/parsing

1 file changed

+6
-2
lines changed

graphql-dxm-provider/src/main/java/org/jahia/modules/graphql/provider/dxm/sdl/parsing/SDLSchemaService.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,18 @@ public List<GraphQLType> getSDLTypes() {
258258
}
259259

260260
public Set<GraphQLDirective> getDirectives() {
261+
Set<GraphQLDirective> result = new HashSet<>();
261262
if (graphQLSchema == null) {
262263
generateSchema();
263264
}
264265

265266
if (graphQLSchema != null) {
266-
return new HashSet<>(graphQLSchema.getDirectives());
267+
List<GraphQLDirective> directives = graphQLSchema.getDirectives();
268+
if (directives != null) {
269+
result.addAll(directives);
270+
}
267271
}
268-
return null;
272+
return result;
269273
}
270274

271275
public GraphQLSchema getGraphQLSchema() {

0 commit comments

Comments
 (0)