Skip to content

Fix NullPointerException in getStore#359

Merged
zz-jason merged 2 commits into
tikv:masterfrom
birdstorm:fix-null-pointer-in-get-store
Dec 6, 2021
Merged

Fix NullPointerException in getStore#359
zz-jason merged 2 commits into
tikv:masterfrom
birdstorm:fix-null-pointer-in-get-store

Conversation

@birdstorm

Copy link
Copy Markdown
Collaborator

If callWIthRetry returns a null response, getStore will throw NullPointerException.

Signed-off-by: birdstorm <samuelwyf@hotmail.com>
if (resp != null) {
return resp.getStore();
}
return null;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add some comments about:

  1. the possible scenarios where get store fails with a null response
  2. why not throw an exception in those scenarios

@Little-Wallace Little-Wallace left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marsishandsome marsishandsome left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason

zz-jason commented Dec 5, 2021

Copy link
Copy Markdown
Member

/merge

@ti-srebot

Copy link
Copy Markdown
Collaborator

/run-all-tests

@ti-srebot

Copy link
Copy Markdown
Collaborator

@birdstorm merge failed.

@zz-jason zz-jason merged commit bb3ace7 into tikv:master Dec 6, 2021
ti-srebot pushed a commit to ti-srebot/client-java that referenced this pull request Dec 6, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot

Copy link
Copy Markdown
Collaborator

cherry pick to release-3.1 in PR #364

@birdstorm birdstorm deleted the fix-null-pointer-in-get-store branch December 9, 2021 12:07
ankita25 pushed a commit to ankita25/client-java that referenced this pull request Dec 14, 2021
Signed-off-by: Ankita Wagh <awagh@pinterest.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants