Skip to content

Commit

Permalink
Fixed fatal error with null value in column
Browse files Browse the repository at this point in the history
  • Loading branch information
gerdos82 committed May 19, 2021
1 parent 6dcb558 commit 4d949a5
Showing 1 changed file with 2 additions and 4 deletions.
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 4d949a5

Please # to comment.