From: Viktor UZLOV Date: Wed, 4 Aug 2021 09:02:47 +0000 (+0300) Subject: #24636 [CEA] Two items in FIELDS trigger an exception X-Git-Tag: V9_8_0a1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=18dce6fd5ff13fc6581f3a9c6a7a1d3228640f86;p=modules%2Fmed.git #24636 [CEA] Two items in FIELDS trigger an exception --- 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))