Skip to content
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

fix: prevent NPE in Struct with Array that contains null elements #1107

Merged
merged 1 commit into from Apr 27, 2021

Conversation

olavloite
Copy link
Collaborator

A NullPointerException would be thrown when encoding the value to a proto if a Struct value was constructed with an Array field that contained at least one null value, and the type of the array field was boolArray, int64Array or float64Array.

Fixes #1106

…d that contains null elements

A NullPointerException would be thrown when encoding the value to a proto if a Struct value was
constructed with an Array field that contained at least one null value, and the type of the array
field was boolArray, int64Array or float64Array.

Fixes #1106
@olavloite olavloite requested a review from a team as a code owner April 27, 2021 10:05
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 27, 2021
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Apr 27, 2021
@codecov
Copy link

codecov bot commented Apr 27, 2021

Codecov Report

Merging #1107 (1a4cf36) into master (3fd3902) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1107      +/-   ##
============================================
+ Coverage     84.91%   84.98%   +0.06%     
- Complexity     2725     2726       +1     
============================================
  Files           156      156              
  Lines         14410    14410              
  Branches       1379     1379              
============================================
+ Hits          12236    12246      +10     
+ Misses         1605     1594      -11     
- Partials        569      570       +1     
Impacted Files Coverage Δ Complexity Δ
.../src/main/java/com/google/cloud/spanner/Value.java 89.88% <100.00%> (+2.06%) 63.00 <0.00> (ø)
...ain/java/com/google/cloud/spanner/SessionPool.java 89.01% <0.00%> (ø) 75.00% <0.00%> (+1.00%)
...m/google/cloud/spanner/connection/SpannerPool.java 87.70% <0.00%> (+0.53%) 33.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fd3902...1a4cf36. Read the comment docs.

@thiagotnunes thiagotnunes merged commit c414abb into master Apr 27, 2021
@thiagotnunes thiagotnunes deleted the fix-npe-in-struct-with-array-field branch April 27, 2021 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential NullPointerException when using a Struct with an Array field that contains a null value
2 participants