From a8c413ee5a424509b6c0ba37a7044eabf77b09c4 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 19 Jun 2015 18:44:47 +0200 Subject: [PATCH] Don't crash trying to access unknown header style. --- src/libtomahawk/playlist/PlayableProxyModel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libtomahawk/playlist/PlayableProxyModel.cpp b/src/libtomahawk/playlist/PlayableProxyModel.cpp index aeb89c1a4..02a7a9a0e 100644 --- a/src/libtomahawk/playlist/PlayableProxyModel.cpp +++ b/src/libtomahawk/playlist/PlayableProxyModel.cpp @@ -585,6 +585,11 @@ PlayableProxyModel::lessThan( const QModelIndex& left, const QModelIndex& right if ( p1->query() && p2->query() ) { + if ( !m_headerStyle.contains( m_style ) || left.column() >= m_headerStyle[ m_style ].count() ) + { + return lessThan( left.column(), p1->query(), p2->query() ); + } + PlayableModel::Columns col = m_headerStyle[ m_style ].at( left.column() ); return lessThan( col, p1->query(), p2->query() ); }