Code

Switch selection bounds and center to use NR::Maybe, addressing most of the
[inkscape.git] / src / splivarot.cpp
index cf07fba16b84db6b4ca11007eaee96dc355df654..f5f0a6481fa8e159c493b2674f1840ec9d83e8d5 100644 (file)
@@ -1555,8 +1555,11 @@ sp_selected_path_simplify_items(SPDesktop *desktop,
 
   bool didSomething = false;
 
-  NR::Rect selectionBbox = selection->bounds();
-  gdouble selectionSize  = L2(selectionBbox.dimensions());
+  NR::Maybe<NR::Rect> selectionBbox = selection->bounds();
+  if (!selectionBbox) {
+    return false;
+  }
+  gdouble selectionSize  = L2(selectionBbox->dimensions());
 
   gdouble simplifySize  = selectionSize;