Skip to content

Fix NPE when GraphQL argument is a list with a null element #486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

turboezh
Copy link
Contributor

@turboezh turboezh commented Sep 8, 2022

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"])
}

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 8, 2022
@rstoyanchev rstoyanchev added this to the 1.0.2 milestone Sep 9, 2022
@rstoyanchev rstoyanchev added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 9, 2022
@rstoyanchev rstoyanchev self-assigned this Sep 9, 2022
rstoyanchev pushed a commit that referenced this pull request Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants