mirror of https://github.com/vitalif/openscad
toPolygon2d() should never return NULL
parent
defb486a64
commit
91139402ea
|
@ -588,6 +588,9 @@ std::string DxfData::dump() const
|
||||||
return out.str();
|
return out.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
May return an empty polygon, but will not return NULL
|
||||||
|
*/
|
||||||
Polygon2d *DxfData::toPolygon2d() const
|
Polygon2d *DxfData::toPolygon2d() const
|
||||||
{
|
{
|
||||||
Polygon2d *poly = new Polygon2d();
|
Polygon2d *poly = new Polygon2d();
|
||||||
|
@ -602,9 +605,5 @@ Polygon2d *DxfData::toPolygon2d() const
|
||||||
}
|
}
|
||||||
poly->addOutline(outline);
|
poly->addOutline(outline);
|
||||||
}
|
}
|
||||||
if (poly->outlines().size() == 0) {
|
|
||||||
delete poly;
|
|
||||||
poly = NULL;
|
|
||||||
}
|
|
||||||
return poly;
|
return poly;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue