Commit eabad90a authored by Sergey Ivanov's avatar Sergey Ivanov
Browse files

Fixed crash when trying to load cover for track/album without artist.

BUG: 263256
parent b93ba8ad
......@@ -20,6 +20,7 @@ VERSION 2.4.1
<bhargav.1191@gmail.com>. (BR 248690)
BUGFIXES:
* Fixed crash when trying to load cover for track/album without artist. (BR 263256)
* Fixed linking on Solaris 11 (and others?). (BR 264112)
* Fixed temporary podcast download filenames that were to long by using MD5 hash instead.
Thanks to Frank Steinmetzger for the patch. (BR 264813)
......
......@@ -25,6 +25,7 @@
#include <QXmlStreamReader>
#include "core/support/Debug.h"
#include <KLocalizedString>
/*
* CoverFetchUnit
......@@ -589,7 +590,9 @@ CoverFetchArtPayload::prepareLastFmUrls( QXmlStreamReader &xml )
QSet<QString> artistSet;
if( method() == "album.getinfo" )
{
artistSet << normalize( album()->albumArtist()->name() );
artistSet << normalize( ( album() && album()->albumArtist() )
? album()->albumArtist()->name()
: i18n( "Unknown Artist" ) );
}
else if( method() == "album.search" )
{
......@@ -598,7 +601,8 @@ CoverFetchArtPayload::prepareLastFmUrls( QXmlStreamReader &xml )
const Meta::TrackList tracks = album()->tracks();
QStringList artistNames( "Various Artists" );
foreach( const Meta::TrackPtr &track, tracks )
artistNames << track->artist()->name();
artistNames << ( track->artist() ? track->artist()->name()
: i18n( "Unknown Artist" ) );
artistSet = normalize( artistNames ).toSet();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment