Skip to content

Commit

Permalink
fix crash adding features containing missing attributes (fix #6791)
Browse files Browse the repository at this point in the history
  • Loading branch information
brushtyler committed Nov 30, 2012
1 parent 70273b9 commit 1a7ccd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -1023,7 +1023,7 @@ bool QgsOgrProvider::addFeature( QgsFeature& f )
int targetAttributeId = it.key();

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

//if(!s.isEmpty())
Expand Down

0 comments on commit 1a7ccd0

Please sign in to comment.