mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-24 01:39:42 +01:00
TWK-415: Don't crash if the trackproxymodel has an invalid current track
This commit is contained in:
parent
f0a6d4e8bb
commit
498d7052de
@ -212,7 +212,7 @@ AudioEngine::canGoNext()
|
||||
return false;
|
||||
|
||||
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
|
||||
//you're following hasn't started a new track yet...don't do anything
|
||||
|
@ -177,7 +177,7 @@ Tomahawk::result_ptr
|
||||
TrackProxyModel::currentItem() const
|
||||
{
|
||||
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 Tomahawk::result_ptr();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user