summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2011-03-07 19:47:04 +0000
committerJohan Engelen <goejendaagh@zonnet.nl>2011-03-07 19:47:04 +0000
commit15221eba482d2f0a57770b2bfb0926ca1869c4c6 (patch)
tree39107fa2764b6a5e14b0fe183f4e3ee95aa674d3
parentAllow the center handle to be selectable for items having a width or height c... (diff)
downloadinkscape-15221eba482d2f0a57770b2bfb0926ca1869c4c6.tar.gz
inkscape-15221eba482d2f0a57770b2bfb0926ca1869c4c6.zip
add a check for null desktop
Fixed bugs: - https://launchpad.net/bugs/723446 (bzr r10082)
-rw-r--r--src/display/grayscale.cpp8
1 files changed, 6 insertions, 2 deletions
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;
+ }
}
-
+
};