fixes bug GEOT-4514, handling null geometry objects, forward port of #236