From 4f0dd92b64c7b324c9eeb1cfddb2c827bbe74139 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Wed, 11 Sep 2019 00:34:40 +0200 Subject: Fix a crash undoing creation of a SVG 2 Flow --- src/ui/shape-editor-knotholders.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/ui/shape-editor-knotholders.cpp') diff --git a/src/ui/shape-editor-knotholders.cpp b/src/ui/shape-editor-knotholders.cpp index fe53a08ed..02add372f 100644 --- a/src/ui/shape-editor-knotholders.cpp +++ b/src/ui/shape-editor-knotholders.cpp @@ -1814,16 +1814,17 @@ TextKnotHolderEntityShapeInside::knot_get() const // SVG 2 'shape-inside'. We only get here if there is a rectangle shape. SPText *text = dynamic_cast(item); g_assert(text != nullptr); - g_assert(text->style->shape_inside.set); - + // we have a crash on undo cration so remove assert + // g_assert(text->style->shape_inside.set); Geom::Point p; - Geom::OptRect frame = text->get_frame(); - if (frame) { - p = (*frame).corner(2); - } else { - std::cerr << "TextKnotHolderEntityShapeInside::knot_get(): no frame!" << std::endl; + if (text->style->shape_inside.set) { + Geom::OptRect frame = text->get_frame(); + if (frame) { + p = (*frame).corner(2); + } else { + std::cerr << "TextKnotHolderEntityShapeInside::knot_get(): no frame!" << std::endl; + } } - return p; } -- cgit v1.2.3