mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
Add safety if adding zero artists
This commit is contained in:
@@ -319,6 +319,9 @@ TreeModel::onArtistsAdded( const QList<Tomahawk::artist_ptr>& artists )
|
|||||||
{
|
{
|
||||||
finishLoading();
|
finishLoading();
|
||||||
|
|
||||||
|
if ( artists.isEmpty() )
|
||||||
|
return;
|
||||||
|
|
||||||
int c = rowCount( QModelIndex() );
|
int c = rowCount( QModelIndex() );
|
||||||
QPair< int, int > crows;
|
QPair< int, int > crows;
|
||||||
crows.first = c;
|
crows.first = c;
|
||||||
@@ -342,6 +345,7 @@ void
|
|||||||
TreeModel::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const QModelIndex& parent )
|
TreeModel::onTracksAdded( const QList<Tomahawk::query_ptr>& tracks, const QModelIndex& parent )
|
||||||
{
|
{
|
||||||
finishLoading();
|
finishLoading();
|
||||||
|
|
||||||
if ( !tracks.count() )
|
if ( !tracks.count() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user