From: Cédric Aguerre Date: Wed, 25 Feb 2015 09:57:13 +0000 (+0100) Subject: fix sigsegv when trying to visualize a mesh with no field from datasource controller X-Git-Tag: V7_6_0a1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=566e55ef3d04188ec32589040c8a826e33f95c25;p=modules%2Fmed.git fix sigsegv when trying to visualize a mesh with no field from datasource controller --- diff --git a/src/MEDOP/gui/DatasourceController.cxx b/src/MEDOP/gui/DatasourceController.cxx index d694f18bb..ad7c3f53c 100644 --- a/src/MEDOP/gui/DatasourceController.cxx +++ b/src/MEDOP/gui/DatasourceController.cxx @@ -303,6 +303,12 @@ void DatasourceController::OnVisualize() { continue; MEDOP::FieldHandler * fieldHandler = MEDOPFactoryClient::getDataManager()->getFieldHandler(fieldId); + if (! fieldHandler) { + QMessageBox::warning(_salomeModule->getApp()->desktop(), + tr("Operation not allowed"), + tr("No field is defined")); + return; + } DatasourceEvent * event = new DatasourceEvent(); event->eventtype = DatasourceEvent::EVENT_VIEW_OBJECT;