From d465fbadf981deb83d51b224a3dabe0f290f440c Mon Sep 17 00:00:00 2001 From: joncruz Date: Tue, 25 Sep 2007 03:07:34 +0000 Subject: [PATCH] Crash fix --- src/color.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/color.cpp b/src/color.cpp index 6b2281f26..b16d9950f 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -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::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::const_iterator i(icc->colors.begin()), + iEnd(icc->colors.end()); + i != iEnd; ++i) { + css << ", " << *i; + } + css << ')'; } - css << ')'; return css.str(); } -- 2.30.2