Skip to content

Commit de23317

Browse files
committed
VFK: fix compiler warning with gcc 15.1.1
1 parent 926d626 commit de23317

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ogr/ogrsf_frmts/vfk/vfkreadersqlite.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -810,20 +810,18 @@ OGRErr VFKReaderSQLite::AddFeature(IVFKDataBlock *poDataBlock,
810810
{
811811
CPLString osValue;
812812

813-
const VFKProperty *poProperty = nullptr;
814-
815813
const char *pszBlockName = poDataBlock->GetName();
816814
CPLString osCommand;
817815
osCommand.Printf("INSERT INTO '%s' VALUES(", pszBlockName);
818816

819817
for (int i = 0; i < poDataBlock->GetPropertyCount(); i++)
820818
{
821819
const OGRFieldType ftype = poDataBlock->GetProperty(i)->GetType();
822-
poProperty = poFeature->GetProperty(i);
820+
const VFKProperty *poProperty = poFeature->GetProperty(i);
823821
if (i > 0)
824822
osCommand += ",";
825823

826-
if (poProperty->IsNull())
824+
if (!poProperty || poProperty->IsNull())
827825
{
828826
osValue.Printf("NULL");
829827
}
@@ -863,7 +861,8 @@ OGRErr VFKReaderSQLite::AddFeature(IVFKDataBlock *poDataBlock,
863861

864862
if (EQUAL(pszBlockName, "SBP") || EQUAL(pszBlockName, "SBPG"))
865863
{
866-
poProperty = poFeature->GetProperty("PORADOVE_CISLO_BODU");
864+
const VFKProperty *poProperty =
865+
poFeature->GetProperty("PORADOVE_CISLO_BODU");
867866
if (poProperty == nullptr)
868867
{
869868
CPLError(CE_Failure, CPLE_AppDefined,

0 commit comments

Comments
 (0)