Skip to content

Commit

Permalink
Fix NULL->0 in layout table cell
Browse files Browse the repository at this point in the history
Fix #46331
  • Loading branch information
elpaso authored and nyalldawson committed Dec 4, 2021
1 parent 91d7e41 commit a724f0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/layout/qgslayoutitemattributetable.cpp
Expand Up @@ -566,6 +566,7 @@ bool QgsLayoutItemAttributeTable::getTableContents( QgsLayoutTableContents &cont

if ( idx != -1 )
{

const QVariant val = f.attributes().at( idx );

if ( mUseConditionalStyling )
Expand All @@ -576,7 +577,7 @@ bool QgsLayoutItemAttributeTable::getTableContents( QgsLayoutTableContents &cont
style = QgsConditionalStyle::compressStyles( styles );
}

QVariant v = replaceWrapChar( val );
QVariant v = val.isNull() ? QString() : replaceWrapChar( val );
currentRow << Cell( v, style, f );
rowContents << v;
}
Expand Down

0 comments on commit a724f0f

Please sign in to comment.