-
-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unhandled exception CURA issue :Ultimaker/Cura#18092
- Loading branch information
Showing
2 changed files
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1552,7 +1552,10 @@ class PolygonsPart : public Polygons | |
} | ||
ConstPolygonRef outerPolygon() const | ||
{ | ||
return paths[0]; | ||
if (! paths.empty()) | ||
{ | ||
return paths[0]; | ||
} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
saumyaj3
Author
Contributor
|
||
} | ||
|
||
/*! | ||
|
Requesting the outer polygon for an empty polygon is technically is technically an undefined state.
There are three solutions, all with their own downsides/upsides.
outerPolygon
, that we only call the function if we know that the polygon in is non empty.std::optional<ConstPolygonRef>
. This is the "cleanest" solution from a code base perspective but will be a bit invasive to change through out the code.I'm not 100% settled on the best solution