Skip to content

Conversation

@croissant676
Copy link

Prevent NPE when calling equals with parameter null

Prevent NPE when calling equals with parameter null
@pivotal-cla
Copy link

@croissant676 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@croissant676 Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 5, 2022
@jzheaux jzheaux self-assigned this Feb 7, 2022
@jzheaux
Copy link
Contributor

jzheaux commented Feb 7, 2022

Thanks, @croissant676, for the contribution. For it to be accepted, please do the following:

  • Ensure it meets the formatting guidelines (check out the project locally and run ./gradlew format check)
  • Add a test that fails before your fix, but passes after your fix

@jzheaux jzheaux added in: core An issue in spring-security-core type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 7, 2022
@jzheaux jzheaux added this to the 5.7.x milestone Feb 7, 2022
@jzheaux
Copy link
Contributor

jzheaux commented Feb 15, 2022

@croissant676, looking at this more closely, it appears to be unnecessary. In fact, when I create a test like so:

assertThat(new SimpleGrantedAuthority("ROLE_TEST").equals(null)).isFalse()

the test passes just fine since the instanceof returns false.

Because of that, I'm going to decline this PR. That said, if you can add a test that demonstrates the need for the change, I'm happy to reopen.

@jzheaux jzheaux closed this Feb 15, 2022
@jzheaux jzheaux added status: declined A suggestion or change that we don't feel we should currently apply in: core An issue in spring-security-core and removed in: core An issue in spring-security-core status: declined A suggestion or change that we don't feel we should currently apply labels Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core An issue in spring-security-core type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants