Code

part of bug #339660; can not use Add/Rename dialog to create layer with no proper...
[inkscape.git] / src / color.cpp
index 6b2281f2697457dde841dd58e3dc5391f7df25aa..b16d9950fec134755ad423e89656ba60dd7f4333 100644 (file)
@@ -191,16 +191,18 @@ std::string SPColor::toString() const
     sp_svg_write_color(tmp, sizeof(tmp), toRGBA32(0x0ff));
     css << tmp;
 
-    if ( !css.str().empty() ) {
-        css << " ";
-    }
-    css << "icc-color(" << icc->colorProfile;
-    for (vector<double>::const_iterator i(icc->colors.begin()),
-             iEnd(icc->colors.end());
-         i != iEnd; ++i) {
-        css << ", " << *i;
+    if ( icc ) {
+        if ( !css.str().empty() ) {
+            css << " ";
+        }
+        css << "icc-color(" << icc->colorProfile;
+        for (vector<double>::const_iterator i(icc->colors.begin()),
+                 iEnd(icc->colors.end());
+             i != iEnd; ++i) {
+            css << ", " << *i;
+        }
+        css << ')';
     }
-    css << ')';
 
     return css.str();
 }