X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FInteraction%2FSeedWidget.cxx;h=73d13a5b1853320d213bd374f276933946856994;hb=e2fb8817731f6231d34941a208e46b36dad425b2;hp=3460532ba22cbcec8231cdc626de53d370fd18e3;hpb=fdd4f2cec18107de380ebd350cb1019eed7c294c;p=cpPlugins.git diff --git a/lib/cpExtensions/Interaction/SeedWidget.cxx b/lib/cpExtensions/Interaction/SeedWidget.cxx index 3460532..73d13a5 100644 --- a/lib/cpExtensions/Interaction/SeedWidget.cxx +++ b/lib/cpExtensions/Interaction/SeedWidget.cxx @@ -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;