summaryrefslogtreecommitdiffstats
path: root/src/xml/repr-sorting.cpp
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2012-05-12 11:16:29 +0000
committerKris <Kris.De.Gussem@hotmail.com>2012-05-12 11:16:29 +0000
commitadc17549c5f0485a30a87e7674c7779ef3155d6c (patch)
tree5d7600ee04a17673e9af977637c4cd89fe5e4938 /src/xml/repr-sorting.cpp
parentFix for externally reported patch by Juergen Weigert, Bug #993500 (inkscape s... (diff)
downloadinkscape-adc17549c5f0485a30a87e7674c7779ef3155d6c.tar.gz
inkscape-adc17549c5f0485a30a87e7674c7779ef3155d6c.zip
syntx of null pointer dereference checks
(bzr r11358)
Diffstat (limited to 'src/xml/repr-sorting.cpp')
-rw-r--r--src/xml/repr-sorting.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/xml/repr-sorting.cpp b/src/xml/repr-sorting.cpp
index 056236d33..fd485925b 100644
--- a/src/xml/repr-sorting.cpp
+++ b/src/xml/repr-sorting.cpp
@@ -13,9 +13,14 @@ Inkscape::XML::Node const *LCA(Inkscape::XML::Node const *a, Inkscape::XML::Node
{
using Inkscape::Algorithms::longest_common_suffix;
Inkscape::XML::Node const *ancestor = longest_common_suffix<Inkscape::XML::NodeConstParentIterator>(
- a, b, NULL, &same_repr
- );
- if ( ancestor && ancestor->type() != Inkscape::XML::DOCUMENT_NODE ) {
+ a, b, NULL, &same_repr);
+ bool OK = false;
+ if (ancestor) {
+ if (ancestor->type() != Inkscape::XML::DOCUMENT_NODE) {
+ OK = true;
+ }
+ }
+ if ( OK ) {
return ancestor;
} else {
return NULL;