1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 16:44:05 +02:00

* Check for colItem not being null, too.

This commit is contained in:
Christian Muehlhaeuser
2014-08-15 11:09:22 +02:00
parent 5d1f0dd360
commit eebf330d2f

View File

@@ -88,7 +88,7 @@ SourceDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex&
if ( type == SourcesModel::Collection || type == SourcesModel::ScriptCollection ) if ( type == SourcesModel::Collection || type == SourcesModel::ScriptCollection )
{ {
SourceItem* colItem = qobject_cast< SourceItem* >( item ); SourceItem* colItem = qobject_cast< SourceItem* >( item );
return QSize( option.rect.width(), ( colItem->source() && colItem->source()->isLocal() ) ? 0 : option.fontMetrics.height() * 3.0 ); return QSize( option.rect.width(), ( colItem && colItem->source() && colItem->source()->isLocal() ) ? 0 : option.fontMetrics.height() * 3.0 );
} }
else if ( type == SourcesModel::Divider ) else if ( type == SourcesModel::Divider )
{ {