summaryrefslogtreecommitdiffstats
path: root/src/sp-item.cpp
diff options
context:
space:
mode:
authorDenis Declara <declara91@gmail.com>2012-05-05 13:32:42 +0000
committerDenis Declara <declara91@gmail.com>2012-05-05 13:32:42 +0000
commitaeb9c1bde66de096910757abb17dedb94ad74207 (patch)
treec0adf97685b0fa8af1553b14d20601f280492762 /src/sp-item.cpp
parentFixed some math, so that the objects now line up correctly (diff)
parentAdding checks to prevent null pointer dereferences (diff)
downloadinkscape-aeb9c1bde66de096910757abb17dedb94ad74207.tar.gz
inkscape-aeb9c1bde66de096910757abb17dedb94ad74207.zip
Trunk merge
(bzr r11073.1.29)
Diffstat (limited to 'src/sp-item.cpp')
-rw-r--r--src/sp-item.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index d6395cfee..e0a9b97f2 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -660,15 +660,19 @@ Inkscape::XML::Node *SPItem::sp_item_write(SPObject *const object, Inkscape::XML
repr->setAttribute ("inkscape:transform-center-y", NULL);
}
- if (item->clip_ref->getObject()) {
- const gchar *value = g_strdup_printf ("url(%s)", item->clip_ref->getURI()->toString());
- repr->setAttribute ("clip-path", value);
- g_free ((void *) value);
- }
- if (item->mask_ref->getObject()) {
- const gchar *value = g_strdup_printf ("url(%s)", item->mask_ref->getURI()->toString());
- repr->setAttribute ("mask", value);
- g_free ((void *) value);
+ if (item->clip_ref){
+ if (item->clip_ref->getObject()) {
+ const gchar *value = g_strdup_printf ("url(%s)", item->clip_ref->getURI()->toString());
+ repr->setAttribute ("clip-path", value);
+ g_free ((void *) value);
+ }
+ }
+ if (item->mask_ref){
+ if (item->mask_ref->getObject()) {
+ const gchar *value = g_strdup_printf ("url(%s)", item->mask_ref->getURI()->toString());
+ repr->setAttribute ("mask", value);
+ g_free ((void *) value);
+ }
}
if (((SPObjectClass *) (SPItemClass::static_parent_class))->write) {