Repository navigation
[GH-3502] Read a NULL GeoPackage geometry as null - #3503
Merged
jiayuasu merged 1 commit intoOct 25, 2026
Merged
Conversation
A NULL in a GeoPackage geometry column comes back from the driver as a null byte array. GeometryReader.extractWKB wrapped it in a ByteBuffer straight away, and the NullPointerException aborted the whole scan. Return null for a null blob instead. Every geometry type in ValuesMapper goes through extractWKB, so this covers all of them. Generated-by: Claude Code (Claude Opus 5.5)
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.
Did you read the Contributor Guide?
Is this PR related to a ticket?
[GH-XXX] my subject. Closes GeoPackage reader throws NullPointerException on a NULL geometry #3502What changes were proposed in this PR?
GeometryReader.extractWKBnow returnsnullwhen the GeoPackage geometry blob is null, which is what the driver returns for a NULL in a geometry column. Previously it calledByteBuffer.wrapon the null array and the NullPointerException aborted the whole scan. Every geometry type inValuesMappergoes throughextractWKB, so this covers all of them.This follows the same pattern as #3353 for NULL date and datetime values and #3410 for numeric and boolean columns.
How was this patch tested?
test_null_geometry.gpkg, a copy oftest_null_values.gpkg(from [GH-3409] Read NULL GeoPackage integer, real and boolean values as null #3410) with row 2's geometry set to NULL and the names relabelled.GeoPackageReaderTest: "should read a NULL geometry as null" reads that file and checks that only row 2 has a null geometry and that itsnameis still read.GeometryReaderTest: "extractWKB returns null for a NULL geometry".Did this PR include necessary documentation updates?
Assisted by Claude Code
Generated-by: Claude Code (Claude Opus 5.5)