1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-04-13 12:31:52 +02:00

* Don't create a playlist when parsing invalid XSPF data.

This commit is contained in:
Christian Muehlhaeuser 2010-12-07 12:34:29 +01:00
parent ea08f1578c
commit e4f9e936ed

View File

@ -1,7 +1,8 @@
#include <QDomDocument>
#include "xspfloader.h"
#include <QDomDocument>
#include <QMessageBox>
#include "tomahawk/tomahawkapp.h"
#include "tomahawk/playlist.h"
@ -80,6 +81,13 @@ XSPFLoader::gotBody()
info = docElement.firstChildElement( "creator" ).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(),
uuid(),
title,