Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[labels] Fix null data defined value was not ignored in some cases
  • Loading branch information
nyalldawson committed Jul 8, 2015
1 parent fa46411 commit eb6279a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/qgslabelpropertydialog.cpp
Expand Up @@ -219,7 +219,7 @@ void QgsLabelPropertyDialog::setDataDefinedValues( const QgsPalLayerSettings &la
}

QVariant result = layerSettings.dataDefinedValue( propIt.key(), mCurLabelFeat, vlayer->pendingFields() );
if ( !result.isValid() )
if ( !result.isValid() || result.isNull() )
{
//could not evaluate data defined value
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgspallabeling.cpp
Expand Up @@ -1205,7 +1205,7 @@ bool QgsPalLayerSettings::dataDefinedEvaluate( DataDefinedProperties p, QVariant

QVariant result = dataDefinedValue( p, *mCurFeat, *mCurFields );

if ( result.isValid() ) // filter NULL values? i.e. && !result.isNull()
if ( result.isValid() && !result.isNull() )
{
//QgsDebugMsgLevel( QString( "result type:" ) + QString( result.typeName() ), 4 );
//QgsDebugMsgLevel( QString( "result string:" ) + result.toString(), 4 );
Expand Down

0 comments on commit eb6279a

Please sign in to comment.