summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2014-03-24 19:41:57 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2014-03-24 19:41:57 +0000
commitdf81a0651a143161602542fa98558a96feda1f0f (patch)
treedfed085908c1a8fa337324e9198cd905634ac112 /src/desktop.cpp
parentmake it easier for people to build with -Werror on Windows (diff)
downloadinkscape-df81a0651a143161602542fa98558a96feda1f0f.tar.gz
inkscape-df81a0651a143161602542fa98558a96feda1f0f.zip
fix potential calls on nullptr
(bzr r13194)
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index a02baeac8..6b5f696e0 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -1537,7 +1537,9 @@ SPDesktop::updateCanvasNow()
void
SPDesktop::setDocument (SPDocument *doc)
{
- if (this->doc() && doc) {
+ if (!doc) return;
+
+ if (this->doc()) {
namedview->hide(this);
this->doc()->getRoot()->invoke_hide(dkey);
}