summaryrefslogtreecommitdiffstats
path: root/src/sp-item.cpp
diff options
context:
space:
mode:
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) {