From dfc3d059f6a909f0a564665e6403552ba7209cd6 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 4 Apr 2014 20:35:16 +0200 Subject: fix crash. If there are more crashes/issues related to references to undefined filters we should fix this in a more general way (e.g. not setting filter.set if invalid href) Note that the file is still in a weird state, the stylesheet is not altered... Fixed bugs: - https://launchpad.net/bugs/1301076 (bzr r13266) --- src/filter-chemistry.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/filter-chemistry.cpp') diff --git a/src/filter-chemistry.cpp b/src/filter-chemistry.cpp index 0f9138560..151480177 100644 --- a/src/filter-chemistry.cpp +++ b/src/filter-chemistry.cpp @@ -378,6 +378,11 @@ SPFilter *modify_filter_gaussian_blur_from_item(SPDocument *document, SPItem *it } SPFilter *filter = SP_FILTER(item->style->getFilter()); + if (!filter) { + // We reach here when filter.set is true, but the href is not found in the document + return new_filter_simple_from_item(document, item, "normal", radius); + } + Inkscape::XML::Document *xml_doc = document->getReprDoc(); // If there are more users for this filter, duplicate it -- cgit v1.2.3