Skip to content

Commit

Permalink
reject empty field names in QgsVectorLayer::addAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n authored and alexbruy committed Feb 11, 2012
1 parent 45d24c9 commit 78d2ee7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/qgsvectorlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() )
Expand Down

0 comments on commit 78d2ee7

Please sign in to comment.