From b18fcee58653e86bb3896b251220f9cf77a4b363 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Fri, 18 Jun 2010 16:06:51 +0000 Subject: [PATCH] Fix a crash when clearing a playlist --- src/playlist/playlistmanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/playlist/playlistmanager.cpp b/src/playlist/playlistmanager.cpp index 1048e47d1..5a3807a7d 100644 --- a/src/playlist/playlistmanager.cpp +++ b/src/playlist/playlistmanager.cpp @@ -203,6 +203,9 @@ void PlaylistManager::UpdateSummaryText() { // Get the length of the selected tracks foreach (const QItemSelectionRange& range, current_selection_) { + if (!range.isValid()) + continue; + selected += range.bottom() - range.top() + 1; for (int i=range.top() ; i<=range.bottom() ; ++i) { int length = range.model()->index(i, Playlist::Column_Length).data().toInt();