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/helper-observer.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/xml/helper-observer.cpp') diff --git a/src/xml/helper-observer.cpp b/src/xml/helper-observer.cpp index ce902ba75..c54dd8e74 100644 --- a/src/xml/helper-observer.cpp +++ b/src/xml/helper-observer.cpp @@ -13,10 +13,16 @@ void SignalObserver::set(SPObject* o) { // XML Tree being used direcly in this function in the following code // while it shouldn't be - if(_oldsel && _oldsel->getRepr()) - _oldsel->getRepr()->removeObserver(*this); - if(o && o->getRepr()) - o->getRepr()->addObserver(*this); + if(_oldsel) { + if (_oldsel->getRepr()) { + _oldsel->getRepr()->removeObserver(*this); + } + } + if(o) { + if (o->getRepr()) { + o->getRepr()->addObserver(*this); + } + } _oldsel = o; } -- cgit v1.2.3