From 2f5ebd20712c38a4e20f20af786b16faee5dc27b Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 4 Nov 2011 08:05:27 +0100 Subject: [PATCH] * Don't get stuck searching for another item if the TreeModel is empty. --- src/libtomahawk/playlist/treeproxymodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libtomahawk/playlist/treeproxymodel.cpp b/src/libtomahawk/playlist/treeproxymodel.cpp index 5530d9aae..206bbd1b7 100644 --- a/src/libtomahawk/playlist/treeproxymodel.cpp +++ b/src/libtomahawk/playlist/treeproxymodel.cpp @@ -329,9 +329,9 @@ TreeProxyModel::siblingItem( int itemsAway ) Tomahawk::result_ptr TreeProxyModel::siblingItem( int itemsAway, bool readOnly ) { - qDebug() << Q_FUNC_INFO; - QModelIndex idx = currentIndex(); + if ( !idx.isValid() ) + return Tomahawk::result_ptr(); if ( m_shuffled ) idx = index( qrand() % rowCount( idx.parent() ), 0, idx.parent() );