Previously, if you had geom.NewPointFlat(geom.NoLayout), and tried to
cast it to a WKB or EWKB, a panic would occur instead of invalid layout for
non-GeometryCollections.
This is because the g argument would become nil and hence
g.Layout() would be a nil dereference. Fix that up by not reassigning
g (as Empty() is now part of the interface so we don't need it
dereferenced).
Previously, if you had
geom.NewPointFlat(geom.NoLayout)
, and tried to cast it to a WKB or EWKB, a panic would occur instead of invalid layout for non-GeometryCollections.This is because the
g
argument would becomenil
and henceg.Layout()
would be a nil dereference. Fix that up by not reassigningg
(as Empty() is now part of the interface so we don't need it dereferenced).(this was my bad :P)