mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
TWK-415: Don't crash if the trackproxymodel has an invalid current track
This commit is contained in:
@@ -212,7 +212,7 @@ AudioEngine::canGoNext()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( !m_currentTrack.isNull() && !m_playlist.data()->hasNextItem() &&
|
if ( !m_currentTrack.isNull() && !m_playlist.data()->hasNextItem() &&
|
||||||
m_currentTrack->id() == m_playlist.data()->currentItem()->id() )
|
( m_playlist.data()->currentItem().isNull() || ( m_currentTrack->id() == m_playlist.data()->currentItem()->id() ) ) )
|
||||||
{
|
{
|
||||||
//For instance, when doing a catch-up while listening along, but the person
|
//For instance, when doing a catch-up while listening along, but the person
|
||||||
//you're following hasn't started a new track yet...don't do anything
|
//you're following hasn't started a new track yet...don't do anything
|
||||||
|
@@ -177,7 +177,7 @@ Tomahawk::result_ptr
|
|||||||
TrackProxyModel::currentItem() const
|
TrackProxyModel::currentItem() const
|
||||||
{
|
{
|
||||||
TrackModelItem* item = itemFromIndex( mapToSource( currentIndex() ) );
|
TrackModelItem* item = itemFromIndex( mapToSource( currentIndex() ) );
|
||||||
if ( item && item->query()->playable() )
|
if ( item && !item->query().isNull() && item->query()->playable() )
|
||||||
return item->query()->results().at( 0 );
|
return item->query()->results().at( 0 );
|
||||||
return Tomahawk::result_ptr();
|
return Tomahawk::result_ptr();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user