Skip to content
Permalink
Browse files

reject empty field names in QgsVectorLayer::addAttribute

  • Loading branch information
jef-n committed Feb 1, 2012
1 parent 9e37e34 commit e87ff24009f227acdc242dbe380c29a12b8dd8c6
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/qgsvectorlayer.cpp
@@ -979,8 +979,8 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )

select( attributes, rendererContext.extent() );

if ( ( mRendererV2->capabilities() & QgsFeatureRendererV2::SymbolLevels )
&& mRendererV2->usingSymbolLevels() )
if (( mRendererV2->capabilities() & QgsFeatureRendererV2::SymbolLevels )
&& mRendererV2->usingSymbolLevels() )
drawRendererV2Levels( rendererContext, labeling );
else
drawRendererV2( rendererContext, labeling );
@@ -3426,6 +3426,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 e87ff24

Please sign in to comment.
You can’t perform that action at this time.