From: asl Date: Wed, 14 Oct 2015 05:09:49 +0000 (+0300) Subject: patch for verification of null pointers X-Git-Tag: V8_0_0a1~8^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0432d6677270289aa89dd645baeccd6c0f63d585;p=modules%2Fgui.git patch for verification of null pointers --- diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 7d357e192..6dfe7d49d 100755 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -1148,6 +1148,8 @@ void OCCViewer_ViewWindow::createActions() return; SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); + if( !aResMgr ) + return; QtxAction* aAction; @@ -1886,7 +1888,7 @@ void OCCViewer_ViewWindow::onSwitchInteractionStyle( bool on ) // update action state if method is called outside QtxAction* a = dynamic_cast( toolMgr()->action( SwitchInteractionStyleId ) ); - if ( a->isChecked() != on ) + if ( a && a->isChecked() != on ) a->setChecked( on ); } @@ -1899,7 +1901,7 @@ void OCCViewer_ViewWindow::onSwitchZoomingStyle( bool on ) // update action state if method is called outside QtxAction* a = dynamic_cast( toolMgr()->action( SwitchZoomingStyleId ) ); - if ( a->isChecked() != on ) + if ( a && a->isChecked() != on ) a->setChecked( on ); } diff --git a/src/ViewerTools/ViewerTools_DialogBase.cxx b/src/ViewerTools/ViewerTools_DialogBase.cxx index 8471a1e53..c3114d8a1 100644 --- a/src/ViewerTools/ViewerTools_DialogBase.cxx +++ b/src/ViewerTools/ViewerTools_DialogBase.cxx @@ -57,7 +57,7 @@ void ViewerTools_DialogBase ::onParentShow() { - if(myAction->isChecked()) + if(myAction && myAction->isChecked()) show(); else hide();