Skip to content
Permalink
Browse files
fix crash adding features containing missing attributes (fix #6791)
  • Loading branch information
brushtyler committed Nov 30, 2012
1 parent 70273b9 commit 1a7ccd015d59b2316357af114464b01fea3bea9e
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/providers/ogr/qgsogrprovider.cpp
@@ -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())

0 comments on commit 1a7ccd0

Please sign in to comment.