From 5d1f0dd36086cdd730705ed5f425778502294a42 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 15 Aug 2014 10:57:07 +0200 Subject: [PATCH] * Check for sidebar item actually having an underlying source before accessing it. --- src/tomahawk/sourcetree/SourceDelegate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tomahawk/sourcetree/SourceDelegate.cpp b/src/tomahawk/sourcetree/SourceDelegate.cpp index 45efcda39..36fe89437 100644 --- a/src/tomahawk/sourcetree/SourceDelegate.cpp +++ b/src/tomahawk/sourcetree/SourceDelegate.cpp @@ -88,7 +88,7 @@ SourceDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex& if ( type == SourcesModel::Collection || type == SourcesModel::ScriptCollection ) { SourceItem* colItem = qobject_cast< SourceItem* >( item ); - return QSize( option.rect.width(), colItem->source()->isLocal() ? 0 : option.fontMetrics.height() * 3.0 ); + return QSize( option.rect.width(), ( colItem->source() && colItem->source()->isLocal() ) ? 0 : option.fontMetrics.height() * 3.0 ); } else if ( type == SourcesModel::Divider ) {