Salome HOME
Merge branch 'BR_LAND_COVER_MAP' of ssh://git.salome-platform.org/modules/hydro into... BR_LAND_COVER_MAP v1.5
authorisn <isn@opencascade.com>
Fri, 27 Nov 2015 12:35:07 +0000 (15:35 +0300)
committerisn <isn@opencascade.com>
Fri, 27 Nov 2015 12:35:07 +0000 (15:35 +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
   {