summaryrefslogtreecommitdiffstats
path: root/src/style-internal.cpp
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2014-10-13 08:05:35 +0000
committertavmjong-free <tavmjong@free.fr>2014-10-13 08:05:35 +0000
commit932ab442403e4007b7dfb8e4c587e5d979379df1 (patch)
treeecf298de2d4bfb8abaa66c4c1f0c7a0ff250bb9c /src/style-internal.cpp
parentimprove precision of viewBox in mm (diff)
downloadinkscape-932ab442403e4007b7dfb8e4c587e5d979379df1.tar.gz
inkscape-932ab442403e4007b7dfb8e4c587e5d979379df1.zip
Fix: "Forming reference to null pointer"
(bzr r13606)
Diffstat (limited to 'src/style-internal.cpp')
-rw-r--r--src/style-internal.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/style-internal.cpp b/src/style-internal.cpp
index a55a11403..f8a4a43f7 100644
--- a/src/style-internal.cpp
+++ b/src/style-internal.cpp
@@ -981,7 +981,16 @@ SPIPaint::read( gchar const *str ) {
if (streq(str, "currentColor")) {
set = true;
currentcolor = true;
- setColor( style->color.value.color );
+ if (style) {
+ setColor( style->color.value.color );
+ } else {
+ // Normally an SPIPaint is part of an SPStyle and the value of 'color' is
+ // available. SPIPaint can be used 'stand-alone' (e.g. to parse color values) in
+ // which case a value of 'currentColor' is meaningless, thus we shouldn't reach
+ // here.
+ std::cerr << "SPIPaint::read(): value is 'currentColor' but 'color' not available." << std::endl;
+ setColor( 0 );
+ }
} else if (streq(str, "none")) {
set = true;
noneSet = true;