mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-04 05:07:27 +02:00
* Don't create a playlist when parsing invalid XSPF data.
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
#include <QDomDocument>
|
|
||||||
|
|
||||||
#include "xspfloader.h"
|
#include "xspfloader.h"
|
||||||
|
|
||||||
|
#include <QDomDocument>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include "tomahawk/tomahawkapp.h"
|
#include "tomahawk/tomahawkapp.h"
|
||||||
#include "tomahawk/playlist.h"
|
#include "tomahawk/playlist.h"
|
||||||
|
|
||||||
@@ -80,6 +81,13 @@ XSPFLoader::gotBody()
|
|||||||
info = docElement.firstChildElement( "creator" ).text();
|
info = docElement.firstChildElement( "creator" ).text();
|
||||||
creator = docElement.firstChildElement( "info" ).text();
|
creator = docElement.firstChildElement( "info" ).text();
|
||||||
|
|
||||||
|
if ( title.isEmpty() )
|
||||||
|
{
|
||||||
|
QMessageBox::critical( APP->mainWindow(), tr( "XSPF Error" ), tr( "This is not a valid XSPF playlist." ) );
|
||||||
|
deleteLater();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_playlist = Playlist::create( APP->sourcelist().getLocal(),
|
m_playlist = Playlist::create( APP->sourcelist().getLocal(),
|
||||||
uuid(),
|
uuid(),
|
||||||
title,
|
title,
|
||||||
|
Reference in New Issue
Block a user