From c1462b1c516e6bc8094d5fc48c4aa01fb372414c Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Thu, 5 Dec 2013 22:13:21 +0100 Subject: fix Segmentation fault while exporting to Plain SVG (Bug #1202753) (patch of Anshul Bhatnagar) (bzr r12839) --- src/sp-polygon.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/sp-polygon.cpp') diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp index 10d097e70..302905a62 100644 --- a/src/sp-polygon.cpp +++ b/src/sp-polygon.cpp @@ -82,9 +82,12 @@ Inkscape::XML::Node* SPPolygon::write(Inkscape::XML::Document *xml_doc, Inkscape } /* We can safely write points here, because all subclasses require it too (Lauris) */ - gchar *str = sp_svg_write_polygon(this->_curve->get_pathvector()); - repr->setAttribute("points", str); - g_free(str); + /* While saving polygon element without points attribute _curve is NULL (see bug 1202753) */ + if (this->_curve != NULL) { + gchar *str = sp_svg_write_polygon(this->_curve->get_pathvector()); + repr->setAttribute("points", str); + g_free(str); + } SPShape::write(xml_doc, repr, flags); -- cgit v1.2.3