mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
Fix null pointer crash in treeproxymodel
This commit is contained in:
@@ -230,7 +230,7 @@ Tomahawk::result_ptr
|
|||||||
TreeProxyModel::currentItem() const
|
TreeProxyModel::currentItem() const
|
||||||
{
|
{
|
||||||
TreeModelItem* item = itemFromIndex( mapToSource( currentIndex() ) );
|
TreeModelItem* item = itemFromIndex( mapToSource( currentIndex() ) );
|
||||||
if ( item && item->result()->isOnline() )
|
if ( item && !item->result().isNull() && item->result()->isOnline() )
|
||||||
return item->result();
|
return item->result();
|
||||||
return Tomahawk::result_ptr();
|
return Tomahawk::result_ptr();
|
||||||
}
|
}
|
||||||
@@ -239,6 +239,9 @@ TreeProxyModel::currentItem() const
|
|||||||
QString
|
QString
|
||||||
TreeProxyModel::textForItem( TreeModelItem* item ) const
|
TreeProxyModel::textForItem( TreeModelItem* item ) const
|
||||||
{
|
{
|
||||||
|
if ( !item )
|
||||||
|
return QString();
|
||||||
|
|
||||||
if ( !item->artist().isNull() )
|
if ( !item->artist().isNull() )
|
||||||
{
|
{
|
||||||
return item->artist()->name();
|
return item->artist()->name();
|
||||||
|
Reference in New Issue
Block a user