]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Interaction/SeedWidget.cxx
...
[cpPlugins.git] / lib / cpExtensions / Interaction / SeedWidget.cxx
index 3460532ba22cbcec8231cdc626de53d370fd18e3..73d13a5b1853320d213bd374f276933946856994 100644 (file)
@@ -20,11 +20,16 @@ void cpExtensions::Interaction::SeedWidget::
 SetInteractor( vtkRenderWindowInteractor* rwi )
 {
   this->Superclass::SetInteractor( rwi );
-  TBaseStyle* s = dynamic_cast< TBaseStyle*>( rwi->GetInteractorStyle( ) );
-  if( s != NULL )
+  if( rwi != NULL )
   {
-    s->AddMouseClickCommand( Self::_Click, this );
-    s->AddMouseDoubleClickCommand( Self::_DoubleClick, this );
+    TBaseStyle* s =
+      dynamic_cast< TBaseStyle* >( rwi->GetInteractorStyle( ) );
+    if( s != NULL )
+    {
+      s->AddMouseClickCommand( Self::_Click, this );
+      s->AddMouseDoubleClickCommand( Self::_DoubleClick, this );
+
+    } // fi
 
   } // fi
 }
@@ -55,6 +60,8 @@ _Click(
   )
 {
   SeedWidget* self = reinterpret_cast< SeedWidget* >( data );
+  if( self == NULL )
+    return;
   if( self->WidgetState == vtkSeedWidget::MovingSeed )
     return;