Skip to content

Commit

Permalink
Merge pull request #6 from PDOK/PDOK-12317
Browse files Browse the repository at this point in the history
Fatal error when null value in column
  • Loading branch information
WouterVisscher authored May 19, 2021
2 parents a454071 + 4d949a5 commit 9edf8eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Binary file modified example/example.gpkg
Binary file not shown.
6 changes: 2 additions & 4 deletions sieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,6 @@ func readFeatures(h *gpkg.Handle, preSieve chan feature, t table) {
var c []interface{}

for i, colName := range cols {
if vals[i] == nil {
continue
}
switch colName {
case t.gcolumn:
wkbgeom, err := gpkg.DecodeGeometry(vals[i].([]byte))
Expand All @@ -263,7 +260,6 @@ func readFeatures(h *gpkg.Handle, preSieve chan feature, t table) {
}
f.geometry = wkbgeom.Geometry
default:
// Grab any non-nil, non-id, non-bounding box, & non-geometry column as a tag
switch v := vals[i].(type) {
case []uint8:
asBytes := make([]byte, len(v))
Expand All @@ -279,6 +275,8 @@ func readFeatures(h *gpkg.Handle, preSieve chan feature, t table) {
c = append(c, v)
case string:
c = append(c, v)
case nil:
c = append(c, v)
default:
log.Printf("unexpected type for sqlite column data: %v: %T", cols[i], v)
}
Expand Down

0 comments on commit 9edf8eb

Please # to comment.