Skip to content
Permalink
Browse files
reject empty field names in QgsVectorLayer::addAttribute
  • Loading branch information
jef-n authored and alexbruy committed Feb 11, 2012
1 parent 45d24c9 commit 78d2ee71b19264d5b67a73511aa8cefab18cd8a6
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/core/qgsvectorlayer.cpp
@@ -3324,6 +3324,9 @@ bool QgsVectorLayer::addAttribute( const QgsField &field )
if ( !isEditable() )
return false;

if ( field.name().isEmpty() )
return false;

for ( QgsFieldMap::const_iterator it = mUpdatedFields.begin(); it != mUpdatedFields.end(); it++ )
{
if ( it.value().name() == field.name() )

0 comments on commit 78d2ee7

Please sign in to comment.