From adc17549c5f0485a30a87e7674c7779ef3155d6c Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 12 May 2012 13:16:29 +0200 Subject: syntx of null pointer dereference checks (bzr r11358) --- src/xml/repr-sorting.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/xml/repr-sorting.cpp') 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( - 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; -- cgit v1.2.3