Null checked for source when calling sourceRef#21431
Merged
javanna merged 2 commits intoelastic:masterfrom Nov 10, 2016
Merged
Conversation
Contributor
|
Hi @thanhtien522 Thanks for the PR. Any chance we can add a failing unit test that passes with your fix in place? |
javanna
suggested changes
Nov 9, 2016
Contributor
javanna
left a comment
There was a problem hiding this comment.
thanks for the PR! I left a small comment, would it also be possible to have a small unit test for this added to InternalSearchHitTests?
| @Override | ||
| public BytesReference sourceRef() { | ||
| if (this.source == null) | ||
| return null; |
Contributor
There was a problem hiding this comment.
could you please add the curly brackets around this statement? we tend to use them although not needed around a single, for better readability.
- add the curly brackets around statement - add unit test for this case
nik9000
approved these changes
Nov 10, 2016
Contributor
Author
|
retest this please |
Contributor
|
@elasticmachine test this please |
javanna
pushed a commit
to javanna/elasticsearch
that referenced
this pull request
Nov 10, 2016
…#21431) Add null check in InternalSearchHit#sourceRef to prevent NPE Closes elastic#19279
javanna
pushed a commit
to javanna/elasticsearch
that referenced
this pull request
Nov 10, 2016
…#21431) Add null check in InternalSearchHit#sourceRef to prevent NPE Closes elastic#19279
javanna
pushed a commit
to javanna/elasticsearch
that referenced
this pull request
Nov 10, 2016
…#21431) Add null check in InternalSearchHit#sourceRef to prevent NPE Closes elastic#19279
jasontedor
added a commit
that referenced
this pull request
Nov 11, 2016
* master: (516 commits) Avoid angering Log4j in TransportNodesActionTests Add trace logging when aquiring and releasing operation locks for replication requests Fix handler name on message not fully read Remove accidental import. Improve log message in TransportNodesAction Clean up of Script. Update Joda Time to version 2.9.5 (#21468) Remove unused ClusterService dependency from SearchPhaseController (#21421) Remove max_local_storage_nodes from elasticsearch.yml (#21467) Wait for all reindex subtasks before rethrottling Correcting a typo-Maan to Man-in README.textile (#21466) Fix InternalSearchHit#hasSource to return the proper boolean value (#21441) Replace all index date-math examples with the URI encoded form Fix typos (#21456) Adapt ES_JVM_OPTIONS packaging test to ubuntu-1204 Add null check in InternalSearchHit#sourceRef to prevent NPE (#21431) Add VirtualBox version check (#21370) Export ES_JVM_OPTIONS for SysV init Skip reindex rethrottle tests with workers Make forbidden APIs be quieter about classpath warnings (#21443) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sourceRefalways throwNullPointerExceptionwhensourceisnullCloses #19279