1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-18 23:17:59 +01:00

* Don't crash in ContextView when no query is selected.

This commit is contained in:
Christian Muehlhaeuser 2014-08-25 14:12:37 +02:00
parent 21a24e2b85
commit a9370808d2

View File

@ -159,7 +159,12 @@ ContextView::onQuerySelected( const Tomahawk::query_ptr& query )
}
m_query = query;
connect( m_query->track().data(), SIGNAL( updated() ), SLOT( onCoverUpdated() ) );
if ( m_query )
{
connect( m_query->track().data(), SIGNAL( updated() ), SLOT( onCoverUpdated() ) );
}
onCoverUpdated();
}
@ -167,7 +172,7 @@ ContextView::onQuerySelected( const Tomahawk::query_ptr& query )
void
ContextView::onCoverUpdated()
{
if ( m_query->track()->cover( QSize( 0, 0 ) ).isNull() )
if ( !m_query || m_query->track()->cover( QSize( 0, 0 ) ).isNull() )
{
m_pixmap = QPixmap();
emit pixmapChanged( m_pixmap );