Fix only deleted topology can have geom = NULL (fixes #818)