Skip to content

Commit 3387392

Browse files
committed
[labels] Fix null data defined value was not ignored in some cases
Cherry-picked from eb6279a
1 parent 29a7bf7 commit 3387392

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/app/qgslabelpropertydialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void QgsLabelPropertyDialog::setDataDefinedValues( const QgsPalLayerSettings &la
219219
}
220220

221221
QVariant result = layerSettings.dataDefinedValue( propIt.key(), mCurLabelFeat, vlayer->pendingFields() );
222-
if ( !result.isValid() )
222+
if ( !result.isValid() || result.isNull() )
223223
{
224224
//could not evaluate data defined value
225225
continue;

src/core/qgspallabeling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ bool QgsPalLayerSettings::dataDefinedEvaluate( DataDefinedProperties p, QVariant
12051205

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

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

0 commit comments

Comments
 (0)