]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
fix sigsegv when trying to visualize a mesh with no field from datasource controller
authorCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 25 Feb 2015 09:57:13 +0000 (10:57 +0100)
committerCédric Aguerre <cedric.aguerre@edf.fr>
Wed, 25 Feb 2015 09:57:13 +0000 (10:57 +0100)
src/MEDOP/gui/DatasourceController.cxx

index d694f18bbcb61a99f77714d7375325cf3e000fde..ad7c3f53c504d415723856b2fe6260316d6ebc58 100644 (file)
@@ -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;