From ece7943512b9697a5bc325692a8b5ab447651549 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Thu, 28 Aug 2014 23:59:09 +0200 Subject: [PATCH] * Don't crash in ScriptCommand_AllAlbums. --- src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp b/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp index b1d34679c..06764e5fc 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp +++ b/src/libtomahawk/resolvers/ScriptCommand_AllAlbums.cpp @@ -67,7 +67,7 @@ ScriptCommand_AllAlbums::exec() return; } - if ( m_artist.isNull() ) + if ( !m_artist ) { reportFailure(); return; @@ -83,7 +83,9 @@ ScriptCommand_AllAlbums::exec() void ScriptCommand_AllAlbums::reportFailure() { - tDebug() << Q_FUNC_INFO << "for collection" << m_collection->name() << "and artist" << m_artist->name(); + if ( m_artist ) + tDebug() << Q_FUNC_INFO << "for collection" << m_collection->name() << "and artist" << m_artist->name(); + emit albums( QList< Tomahawk::album_ptr >() ); emit done(); }