From: ageay Date: Fri, 12 Aug 2011 08:29:17 +0000 (+0000) Subject: Some bug protection with an explicit message. X-Git-Tag: V6_main_FINAL~991 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5eda4060c59338c36460037609a97ddaea6b4515;p=tools%2Fmedcoupling.git Some bug protection with an explicit message. --- diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index 58a9097a6..47a1771ce 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -2313,6 +2313,9 @@ void MEDLoaderNS::appendCellProfileField(const char *fileName, const ParaMEDMEM: */ med_idt MEDLoaderNS::appendFieldSimpleAtt(const char *fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, med_int& numdt, med_int& numo, med_float& dt) { + std::string fieldName(f->getName()); + if(fieldName.empty()) + throw INTERP_KERNEL::Exception("MEDLoaderNS::appendFieldSimpleAtt : Trying to store a field with no name ! MED file format requires a NON EMPTY field name !"); med_idt fid=MEDfileOpen(fileName,MED_ACC_RDWR); int nbComp=f->getNumberOfComponents(); INTERP_KERNEL::AutoPtr comp=MEDLoaderBase::buildEmptyString(nbComp*MED_SNAME_SIZE);