//----------------------------------------------------------------------------
bool VISU_GaussPtsAct::IsInfinitive()
{
- vtkMapper *pMapper =GetMapper();
- vtkDataSet* pDS=pMapper->GetInput();
- pDS->Update();
- int aNb=pDS->GetNumberOfCells();
- if (aNb<2) {
- myIsInfinite=true;
+ if(vtkMapper* aMapper = GetMapper()){
+ if(vtkDataSet* aDataSet= aMapper->GetInput()){
+ aDataSet->Update();
+ myIsInfinite = aDataSet->GetNumberOfCells() < 2;
}
- else{
- myIsInfinite=false;
}
return myIsInfinite;
}