From 0432d6677270289aa89dd645baeccd6c0f63d585 Mon Sep 17 00:00:00 2001 From: asl Date: Wed, 14 Oct 2015 08:09:49 +0300 Subject: [PATCH] patch for verification of null pointers --- src/OCCViewer/OCCViewer_ViewWindow.cxx | 6 ++++-- src/ViewerTools/ViewerTools_DialogBase.cxx | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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(); -- 2.39.2