From 15221eba482d2f0a57770b2bfb0926ca1869c4c6 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 7 Mar 2011 20:47:04 +0100 Subject: add a check for null desktop Fixed bugs: - https://launchpad.net/bugs/723446 (bzr r10082) --- src/display/grayscale.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/display/grayscale.cpp') diff --git a/src/display/grayscale.cpp b/src/display/grayscale.cpp index af3a781b0..37f2b255c 100644 --- a/src/display/grayscale.cpp +++ b/src/display/grayscale.cpp @@ -73,9 +73,13 @@ guchar luminance(guchar r, guchar g, guchar b) { * happening... */ bool activeDesktopIsGrayscale() { - return (SP_ACTIVE_DESKTOP->getColorMode() == Inkscape::COLORRENDERMODE_GRAYSCALE); + if (SP_ACTIVE_DESKTOP) { + return (SP_ACTIVE_DESKTOP->getColorMode() == Inkscape::COLORRENDERMODE_GRAYSCALE); + } else { + return false; + } } - + }; -- cgit v1.2.3