From: isn Date: Fri, 27 Nov 2015 12:34:35 +0000 (+0300) Subject: refs #762 X-Git-Tag: v1.5~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=579593d206d5841e3141173e95cf48742bb462d9;p=modules%2Fhydro.git refs #762 --- diff --git a/src/HYDROData/HYDROData_ShapeFile.cxx b/src/HYDROData/HYDROData_ShapeFile.cxx index 559fd739..93a75c2a 100644 --- a/src/HYDROData/HYDROData_ShapeFile.cxx +++ b/src/HYDROData/HYDROData_ShapeFile.cxx @@ -115,7 +115,7 @@ void HYDROData_ShapeFile::Export(const QString& aFileName, const Handle_HYDRODat if (bCheckLinear && !aLCM->CheckLinear()) return; // - SHPHandle hSHPHandle; + SHPHandle hSHPHandle = NULL; if ( !aLCM.IsNull() && !aLCM->IsEmpty()) { hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_POLYGON ); @@ -127,7 +127,7 @@ void HYDROData_ShapeFile::Export(const QString& aFileName, const Handle_HYDRODat aNonExpList.append(aLCM->GetName() + "_" + QString::number(It.Index())); } } - if (hSHPHandle->nRecords > 0) + if (hSHPHandle && hSHPHandle->nRecords > 0) SHPClose( hSHPHandle ); else {