From 579593d206d5841e3141173e95cf48742bb462d9 Mon Sep 17 00:00:00 2001 From: isn Date: Fri, 27 Nov 2015 15:34:35 +0300 Subject: [PATCH] refs #762 --- src/HYDROData/HYDROData_ShapeFile.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 { -- 2.39.2