From 566e55ef3d04188ec32589040c8a826e33f95c25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Aguerre?= Date: Wed, 25 Feb 2015 10:57:13 +0100 Subject: [PATCH] fix sigsegv when trying to visualize a mesh with no field from datasource controller --- src/MEDOP/gui/DatasourceController.cxx | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.39.2