From 18dce6fd5ff13fc6581f3a9c6a7a1d3228640f86 Mon Sep 17 00:00:00 2001 From: Viktor UZLOV Date: Wed, 4 Aug 2021 12:02:47 +0300 Subject: [PATCH] #24636 [CEA] Two items in FIELDS trigger an exception --- src/MEDCalc/gui/DatasourceController.cxx | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/MEDCalc/gui/DatasourceController.cxx b/src/MEDCalc/gui/DatasourceController.cxx index 75ebaa161..49a2a0720 100644 --- a/src/MEDCalc/gui/DatasourceController.cxx +++ b/src/MEDCalc/gui/DatasourceController.cxx @@ -243,11 +243,11 @@ void DatasourceController::OnExpandField() // First retrieve the fieldseries id associated to this study object SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributeParameter_var aParam; - if ( soFieldseries->FindAttribute(anAttr,"AttributeParameter") ) { - aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); - if (! aParam->IsSet(FIELD_SERIES_ID, PT_INTEGER)) - return; - } + if ( !soFieldseries->FindAttribute(anAttr,"AttributeParameter") ) + return; + aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); + if (! aParam->IsSet(FIELD_SERIES_ID, PT_INTEGER)) + return; long fieldseriesId = aParam->GetInt(FIELD_SERIES_ID); STDLOG("Expand the field timeseries "<FindAttribute(anAttr,"AttributeParameter") ) { - aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); - if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN)) - return; - } + if ( !soField->FindAttribute(anAttr,"AttributeParameter") ) + return; + aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); + if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN)) + return; bool isInWorkspace = aParam->GetBool(IS_IN_WORKSPACE); if ( isInWorkspace ) { QMessageBox::warning(_salomeModule->getApp()->desktop(), @@ -366,11 +366,11 @@ void DatasourceController::OnUseInWorkspace() { continue; SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributeParameter_var aParam; - if ( soField->FindAttribute(anAttr,"AttributeParameter") ) { - aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); - if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN)) - return; - } + if ( !soField->FindAttribute(anAttr,"AttributeParameter") ) + return; + aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); + if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN)) + return; bool isInWorkspace = aParam->GetBool(IS_IN_WORKSPACE); if ( !isInWorkspace ) { if (! aParam->IsSet(FIELD_ID, PT_INTEGER)) -- 2.39.2