From a3586011a8863da60bf30077f6eec03d79fdbcbc Mon Sep 17 00:00:00 2001 From: Thomas Frauendorfer Date: Sun, 25 Oct 2009 00:37:50 +0200 Subject: [PATCH] OTHER: fix some possible segfaults --- backend_xmmsclient++/xcollection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend_xmmsclient++/xcollection.cpp b/backend_xmmsclient++/xcollection.cpp index 6b62d88..c14f87d 100644 --- a/backend_xmmsclient++/xcollection.cpp +++ b/backend_xmmsclient++/xcollection.cpp @@ -234,6 +234,8 @@ XCollection::playlistAddUrl (QString url, QString plsname) bool XCollection::playlistAddUrl (QUrl url, QString plsname) { + if (!m_client->isConnected ()) return false; + //TODO: more tests if file is valid if (!url.isValid ()) { return false; @@ -252,6 +254,8 @@ XCollection::playlistAddUrl (QUrl url, QString plsname) bool XCollection::playlistClear (QString name) { + if (!m_client->isConnected ()) return false; + if (name == "") { name = d->m_activePlaylist; } @@ -263,6 +267,8 @@ XCollection::playlistClear (QString name) bool XCollection::addPlsFile (QUrl url) { + if (!m_client->isConnected ()) return false; + if (url.scheme ().isEmpty ()) { //the protocol identifier is missing //we guess we might be local, so just add file://