1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-01 20:00:13 +02:00

DownloadJob: make sure resolvedBy() is not null

This commit is contained in:
Mickaël Thomas
2016-05-21 19:28:50 +02:00
parent abc00b4758
commit 7e54e506df

View File

@@ -209,9 +209,13 @@ DownloadJob::download()
setState( Running );
Tomahawk::ScriptJob *job = m_result->resolvedBy()->getDownloadUrl( m_result, m_format );
connect( job, SIGNAL( done(QVariantMap) ), SLOT( onUrlRetrieved(QVariantMap) ) );
job->start();
if (m_result->resolvedBy() != nullptr) {
Tomahawk::ScriptJob *job = m_result->resolvedBy()->getDownloadUrl( m_result, m_format );
connect( job, SIGNAL( done(QVariantMap) ), SLOT( onUrlRetrieved(QVariantMap) ) );
job->start();
} else {
onUrlRetrieved({{"url", m_format.url}});
}
return true;
}