Fix ticket #5584 (crash saving empty geometry)