From 4a00ff4d24f04f921f120001848bd1b3b1bf0a0a Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 7 Jul 2012 02:26:17 +0200 Subject: [PATCH] * Fixed crash in ContextMenu. --- src/libtomahawk/ContextMenu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libtomahawk/ContextMenu.cpp b/src/libtomahawk/ContextMenu.cpp index 9f226450a..25328b284 100644 --- a/src/libtomahawk/ContextMenu.cpp +++ b/src/libtomahawk/ContextMenu.cpp @@ -122,6 +122,9 @@ ContextMenu::setQueries( const QList& queries ) void ContextMenu::setQuery( const Tomahawk::query_ptr& query ) { + if ( query.isNull() ) + return; + QList queries; queries << query; setQueries( queries ); @@ -306,6 +309,9 @@ ContextMenu::openPage() void ContextMenu::onSocialActionsLoaded() { + if ( m_queries.isEmpty() || m_queries.first().isNull() ) + return; + if ( m_queries.first()->loved() ) { m_loveAction->setText( tr( "Un-&Love" ) );