summaryrefslogtreecommitdiffstats
path: root/src/style-internal.cpp
diff options
context:
space:
mode:
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;