mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 19:30:21 +02:00
be careful
This commit is contained in:
@@ -196,6 +196,9 @@ CollectionItem::playlistDeletedInternal( SourceTreeItem* parent, const T& p )
|
|||||||
if( parent->children().isEmpty() && parent->parent() ) // Don't leave an empty Playlist or Station category
|
if( parent->children().isEmpty() && parent->parent() ) // Don't leave an empty Playlist or Station category
|
||||||
{
|
{
|
||||||
int idx = parent->parent()->children().indexOf( parent );
|
int idx = parent->parent()->children().indexOf( parent );
|
||||||
|
if( idx < 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
parent->parent()->beginRowsRemoved( idx, idx );
|
parent->parent()->beginRowsRemoved( idx, idx );
|
||||||
parent->parent()->removeChild( parent );
|
parent->parent()->removeChild( parent );
|
||||||
parent->parent()->endRowsRemoved();
|
parent->parent()->endRowsRemoved();
|
||||||
|
Reference in New Issue
Block a user