From 1e6aacfc7efc57064de2fa9028b132cb8bee050e Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Fri, 27 Jun 2014 17:46:01 +0100 Subject: [PATCH] Don't access NULL pointers which we are reporting failure on --- src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp b/src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp index 008580a67..aadba4637 100644 --- a/src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp +++ b/src/libtomahawk/resolvers/ScriptCommand_AllTracks.cpp @@ -74,7 +74,13 @@ ScriptCommand_AllTracks::exec() void ScriptCommand_AllTracks::reportFailure() { - tDebug() << Q_FUNC_INFO << "for collection" << m_collection->name() << " artist" << m_album->artist()->name() << " album" << m_album->name(); + if ( m_album && m_collection ) + tDebug() << Q_FUNC_INFO << "for collection" << m_collection->name() << " artist" << m_album->artist()->name() << " album" << m_album->name(); + else if ( m_collection ) + tDebug() << Q_FUNC_INFO << "for collection" << m_collection->name() << " (no more information available)"; + else + tDebug() << Q_FUNC_INFO; + emit tracks( QList< Tomahawk::query_ptr >() ); emit done(); }