Skip to content

Commit

Permalink
Don't try to paint onto null icons
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 18, 2021
1 parent 13b8d2c commit d5058ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/layertree/qgslayertreemodel.cpp
Expand Up @@ -254,7 +254,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
icon = legendIconEmbeddedInParent( nodeLayer );
}

if ( layer->isEditable() && testFlag( UseTextFormatting ) )
if ( !icon.isNull() && layer->isEditable() && testFlag( UseTextFormatting ) )
{
const int iconSize = scaleIconSize( 16 );
QPixmap pixmap( icon.pixmap( iconSize, iconSize ) );
Expand Down

0 comments on commit d5058ca

Please sign in to comment.