]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #762
authorisn <isn@opencascade.com>
Fri, 27 Nov 2015 12:34:35 +0000 (15:34 +0300)
committerisn <isn@opencascade.com>
Fri, 27 Nov 2015 12:34:35 +0000 (15:34 +0300)
src/HYDROData/HYDROData_ShapeFile.cxx

index 559fd73982ca28a9fc473d3fac80e5647dc0269a..93a75c2a4c212add5c924eefde6668f961afcd02 100644 (file)
@@ -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
   {