#964 Catch precondition exception for malformed (self-intersecting) polygons to avoid a crash