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 github-actions[bot] committed Dec 3, 2021
1 parent 2286621 commit 12ce860
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 12ce860

Please sign in to comment.