summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-10-13 08:21:07 +0000
committertavmjong-free <tavmjong@free.fr>2014-10-13 08:21:07 +0000
commitfd587105dcf2e883a6712013b7ea7ce6e3b3b11d (patch)
tree255930d01e183c88ce733edd8f657d4d07ed9aaa
parentFix: "Forming reference to null pointer" (diff)
downloadinkscape-fd587105dcf2e883a6712013b7ea7ce6e3b3b11d.tar.gz
inkscape-fd587105dcf2e883a6712013b7ea7ce6e3b3b11d.zip
Fix "Called C++ object pointer is null"
(bzr r13607)
-rw-r--r--src/style-internal.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index f8a4a43f7..a81a2799d 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -1405,11 +1405,20 @@ SPIFilter::read( gchar const *str ) {
set = true;
// Create href if not already done.
- if (!href && style->object) {
- href = new SPFilterReference(style->object);
- href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_filter_ref_changed), style));
+ if (!href) {
+ if (style->object) {
+ href = new SPFilterReference(style->object);
+ }
+ // Do we have href now?
+ if ( href ) {
+ href->changedSignal().connect(sigc::bind(sigc::ptr_fun(sp_style_filter_ref_changed), style));
+ } else {
+ std::cerr << "SPIFilter::read(): Could not allocate 'href'" << std::endl;
+ return;
+ }
}
+ // We have href
try {
href->attach(Inkscape::URI(uri));
} catch (Inkscape::BadURIException &e) {