Skip to content

Eagerly return null values in AbstractOperations.deserializeGeoResults(…) to avoid null dereference - #2280

Closed
yarooh wants to merge 1 commit into
spring-projects:2.7.xfrom
yarooh:issue/2279
Closed

yarooh wants to merge 1 commit into
spring-projects:2.7.xfrom
yarooh:issue/2279

Conversation

@yarooh

@yarooh yarooh commented Mar 14, 2022

Copy link
Copy Markdown

In LettuceConnection pipeline mode, using DefaultGeoOperations to call geo-related methods will get null, then convert the return value by calling method deserializeGeoResults will throw NPE.
To avoid NPE,check if the source is null before deserializeGeoResults conversion.

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

In LettuceConnection pipeline mode, using DefaultGeoOperations to call
geo-related methods will get null, then convert the return value by
calling method deserializeGeoResults will throw NPE.
To avoid NPE,
check if the source is null before deserializeGeoResults conversion.
@pivotal-cla

Copy link
Copy Markdown

@yarooh Please sign the Contributor License Agreement!

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

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 14, 2022
@pivotal-cla

Copy link
Copy Markdown

@yarooh Thank you for signing the Contributor License Agreement!

@yarooh yarooh changed the title fix: fix:issue/2279 Mar 14, 2022
@christophstrobl christophstrobl added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 28, 2022
@christophstrobl
christophstrobl requested a review from mp911de March 28, 2022 14:23
@mp911de mp911de changed the title fix:issue/2279 Eagerly return null values in AbstractOperations.deserializeGeoResults(…) to avoid null dereference Mar 31, 2022
mp911de pushed a commit that referenced this pull request Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
mp911de pushed a commit that referenced this pull request Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
mp911de pushed a commit that referenced this pull request Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
@mp911de

mp911de commented Mar 31, 2022

Copy link
Copy Markdown
Member

Thank you for your contribution. That's merged, polished, and backported now.

mp911de pushed a commit that referenced this pull request Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
@mp911de mp911de closed this Mar 31, 2022
@mp911de mp911de added this to the 2.5.11 (2021.0.11) milestone Mar 31, 2022
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
@yarooh
yarooh deleted the issue/2279 branch April 1, 2022 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DefaultGeoOperations.radius(…) throws NullPointerException in pipeline mode

5 participants