spring-graphql
spring-graphql copied to clipboard
Fix NPE in argument binder
In case of collection-argument with nullable items.
Passing null items in collection-argument causes NPE in org.springframework.graphql.data.GraphQlArgumentBinder#createCollection
: Cannot invoke "Object.getClass()" because "rawValue" is null
.
Test case: Schema:
type Query {
theData(idList: [ID]!): [String]!
}
Query:
{
theData(idList: ["123", null, "234"])
}
@turboezh Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
@turboezh Thank you for signing the Contributor License Agreement!
Hi, @rstoyanchev. This request was made based on the main branch and I guess this is not a right way. I've made a new one (#486) based on 1.0.x.
Thanks. Keep in mind that we do rebase the PR onto 1.0.x or on top of the latest in main, depending on the target milestones, so typically no need to be concerned with this.