From 1d84f6ede6770682112d3310d93937667b39723f Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 5 Jul 2012 12:13:07 +0200 Subject: [PATCH] * Should fix crash when filtering collection. --- src/libtomahawk/playlist/TreeProxyModel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libtomahawk/playlist/TreeProxyModel.cpp b/src/libtomahawk/playlist/TreeProxyModel.cpp index 19a6a8065..3ee887562 100644 --- a/src/libtomahawk/playlist/TreeProxyModel.cpp +++ b/src/libtomahawk/playlist/TreeProxyModel.cpp @@ -205,13 +205,17 @@ TreeProxyModel::filterAcceptsRow( int sourceRow, const QModelIndex& sourceParent PlayableItem* ti = sourceModel()->itemFromIndex( sourceModel()->index( i, 0, sourceParent ) ); if ( ti->name() == item->name() && - ( ti->result()->albumpos() == item->result()->albumpos() || ti->result()->albumpos() == 0 || item->result()->albumpos() == 0 ) ) + ( ti->result()->albumpos() == item->result()->albumpos() || + ti->result()->albumpos() == 0 || item->result()->albumpos() == 0 ) ) { if ( !item->result()->isOnline() && ti->result()->isOnline() ) return false; - if ( !item->result()->collection()->source()->isLocal() && ti->result()->collection()->source()->isLocal() ) + if ( ( item->result()->collection().isNull() || !item->result()->collection()->source()->isLocal() ) && + !ti->result()->collection().isNull() && ti->result()->collection()->source()->isLocal() ) + { return false; + } } } }