Skip to content

Commit 1a7ccd0

Browse files
committed
fix crash adding features containing missing attributes (fix #6791)
1 parent 70273b9 commit 1a7ccd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/providers/ogr/qgsogrprovider.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
10231023
int targetAttributeId = it.key();
10241024

10251025
// don't try to set field from attribute map if it's not present in layer
1026-
if ( targetAttributeId >= OGR_FD_GetFieldCount( fdef ) )
1026+
if ( targetAttributeId < 0 || targetAttributeId >= OGR_FD_GetFieldCount( fdef ) )
10271027
continue;
10281028

10291029
//if(!s.isEmpty())

0 commit comments

Comments
 (0)