summaryrefslogtreecommitdiffstats
path: root/src/id-clash.cpp
diff options
context:
space:
mode:
authorStephen Silver <sasilver@yahoo.com>2008-07-15 13:06:51 +0000
committersasilver <sasilver@users.sourceforge.net>2008-07-15 13:06:51 +0000
commit502664994361c156a07d6ed45a397b7e18c583cb (patch)
tree24164b8d71444b86cc95566cb3d558c162534def /src/id-clash.cpp
parentlpe-skeleton.cpp: comment out handle code by default (diff)
downloadinkscape-502664994361c156a07d6ed45a397b7e18c583cb.tar.gz
inkscape-502664994361c156a07d6ed45a397b7e18c583cb.zip
Don't crash on broken references when resolving ID clashes.
(bzr r6324)
Diffstat (limited to 'src/id-clash.cpp')
-rw-r--r--src/id-clash.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/id-clash.cpp b/src/id-clash.cpp
index 1ce30e0dd..5980c9e7b 100644
--- a/src/id-clash.cpp
+++ b/src/id-clash.cpp
@@ -125,19 +125,25 @@ find_references(SPObject *elem, refmap_type *refmap)
for (unsigned i = 0; i < NUM_SPIPAINT_PROPERTIES; ++i) {
const SPIPaint SPStyle::*prop = SPIPaint_members[i];
const SPIPaint *paint = &(style->*prop);
- if (paint->isPaintserver()) {
- const gchar *id = SP_OBJECT_ID(paint->value.href->getObject());
- IdReference idref = { REF_STYLE, elem, SPIPaint_properties[i] };
- (*refmap)[id].push_back(idref);
+ if (paint->isPaintserver() && paint->value.href) {
+ const SPObject *obj = paint->value.href->getObject();
+ if (obj) {
+ const gchar *id = SP_OBJECT_ID(obj);
+ IdReference idref = { REF_STYLE, elem, SPIPaint_properties[i] };
+ (*refmap)[id].push_back(idref);
+ }
}
}
/* check for url(#...) references in 'filter' */
const SPIFilter *filter = &(style->filter);
if (filter->href) {
- const gchar *id = SP_OBJECT_ID(filter->href->getObject());
- IdReference idref = { REF_STYLE, elem, "filter" };
- (*refmap)[id].push_back(idref);
+ const SPObject *obj = filter->href->getObject();
+ if (obj) {
+ const gchar *id = SP_OBJECT_ID(obj);
+ IdReference idref = { REF_STYLE, elem, "filter" };
+ (*refmap)[id].push_back(idref);
+ }
}
/* check for other url(#...) references */