diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-01 21:19:12 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-02 09:14:51 +0100 |
commit | 17dded391d0e3e9045b80095c51cb43a43319857 (patch) | |
tree | 016ea914b2b046683ec816af5313ce63ddf07026 | |
parent | 15174068034af1bd04a394a067350f9aeb6f4d90 (diff) |
coverity#1242420 Dereference after null check
Change-Id: I3ccfcc618b936cab520926adb3a3ff770d000aed
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index f0aa4dbad2fb..446f0727ceb0 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -123,7 +123,7 @@ void TabControl::ImplInit( vcl::Window* pParent, WinBits nStyle ) if( IsNativeControlSupported(CTRL_TAB_PANE, PART_ENTIRE_CONTROL) ) EnableChildTransparentMode( true ); - if ( pParent->IsDialog() ) + if (pParent && pParent->IsDialog()) pParent->AddChildEventListener( LINK( this, TabControl, ImplWindowEventListener ) ); } @@ -192,7 +192,8 @@ TabControl::TabControl( vcl::Window* pParent, WinBits nStyle ) : TabControl::~TabControl() { - if ( GetParent()->IsDialog() ) + Window *pParent = GetParent(); + if (pParent && pParent->IsDialog()) GetParent()->RemoveChildEventListener( LINK( this, TabControl, ImplWindowEventListener ) ); ImplFreeLayoutData(); |