diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2013-12-05 21:13:21 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2013-12-05 21:13:21 +0000 |
| commit | c1462b1c516e6bc8094d5fc48c4aa01fb372414c (patch) | |
| tree | 3c528fa88b01b1b87052c3ee2f31cf2ebf7604b5 /src/sp-polygon.cpp | |
| parent | add null pointer check (diff) | |
| download | inkscape-c1462b1c516e6bc8094d5fc48c4aa01fb372414c.tar.gz inkscape-c1462b1c516e6bc8094d5fc48c4aa01fb372414c.zip | |
fix Segmentation fault while exporting to Plain SVG (Bug #1202753) (patch of Anshul Bhatnagar)
(bzr r12839)
Diffstat (limited to 'src/sp-polygon.cpp')
| -rw-r--r-- | src/sp-polygon.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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); |
