]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Check of ViewManager existance
authorstv <stv@opencascade.com>
Wed, 2 Nov 2011 12:08:19 +0000 (12:08 +0000)
committerstv <stv@opencascade.com>
Wed, 2 Nov 2011 12:08:19 +0000 (12:08 +0000)
src/SUIT/SUIT_Accel.cxx

index 973189d0ada55ee13401aaa0e6c0b776aa845c78..6b5204b96fb12c1f8e60a7e0e2fa1bf7c1deddf4 100644 (file)
@@ -131,11 +131,14 @@ bool SUIT_Accel::eventFilter( QObject *obj, QEvent *event )
   if ( key ) {
     SUIT_ViewWindow* vw = ::getParentViewWindow( obj ); 
     if ( vw ) {
-      QString type = vw->getViewManager()->getViewModel()->getType();
-      if ( myMap.contains( type ) ) {
-        IdActionMap idActionMap = myMap[type];
-        if ( idActionMap.contains( key ) ) {
-          return vw->onAccelAction( idActionMap[key] );
+      if ( vw->getViewManager() && vw->getViewManager()->getViewModel() )
+      {
+        QString type = vw->getViewManager()->getViewModel()->getType();
+        if ( myMap.contains( type ) ) {
+          IdActionMap idActionMap = myMap[type];
+          if ( idActionMap.contains( key ) ) {
+            return vw->onAccelAction( idActionMap[key] );
+          }
         }
       }
     }