You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
The ErrorHandlerSupplier might not be fully initialized when we first need it.
As such, a nasty NPE might arise.
java.lang.NullPointerException: Cannot invoke "graphql.kickstart.execution.error.GraphQLErrorHandler.errorsPresent(java.util.List)" because "errorHandler" is null
at graphql.kickstart.execution.GraphQLObjectMapper.sanitizeErrors(GraphQLObjectMapper.java:131)
at graphql.kickstart.execution.GraphQLObjectMapper.createResultFromExecutionResult(GraphQLObjectMapper.java:140)
at graphql.kickstart.execution.GraphQLObjectMapper.serializeResultAsBytes(GraphQLObjectMapper.java:118)
at graphql.kickstart.servlet.SingleQueryResponseWriter.write(SingleQueryResponseWriter.java:23)
at graphql.kickstart.servlet.HttpRequestInvokerImpl.writeResultResponse(HttpRequestInvokerImpl.java:149)
at graphql.kickstart.servlet.HttpRequestInvokerImpl.writeErrorResponse(HttpRequestInvokerImpl.java:163)
at graphql.kickstart.servlet.HttpRequestInvokerImpl.lambda$handleInternal$5(HttpRequestInvokerImpl.java:137)
at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990)
at java.base/java.util.concurrent.CompletableFuture.uniExceptionallyStage(CompletableFuture.java:1008)
at java.base/java.util.concurrent.CompletableFuture.exceptionally(CompletableFuture.java:2364)
at graphql.kickstart.servlet.HttpRequestInvokerImpl.handleInternal(HttpRequestInvokerImpl.java:135)
at graphql.kickstart.servlet.HttpRequestInvokerImpl.handle(HttpRequestInvokerImpl.java:109)
It's a bit of a race condition when starting the app, so it's a bit tricky to provide steps to reproduce.
Before
publicclassGraphQLErrorStartupListenerimplementsApplicationListener<ApplicationReadyEvent> {
// ... omitted for brevity@OverridepublicvoidonApplicationEvent(ApplicationReadyEventevent) {
// omitted for brevity
}
}
Suggested
Change the type of event being listened, from ApplicationReadyEvent to ApplicationStartedEvent
publicclassGraphQLErrorStartupListenerimplementsApplicationListener<ApplicationStartedEvent> {
// ... omitted for brevity@OverridepublicvoidonApplicationEvent(ApplicationStartedEventevent) {
// unchanged body method
}
}
The
ErrorHandlerSuppliermight not be fully initialized when we first need it.As such, a nasty NPE might arise.
It's a bit of a race condition when starting the app, so it's a bit tricky to provide steps to reproduce.
Before
Suggested
Change the type of event being listened, from
ApplicationReadyEventtoApplicationStartedEvent