-rw-r--r-- | noncore/multimedia/opieplayer3/playlist.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer3/playlist.cpp b/noncore/multimedia/opieplayer3/playlist.cpp index 6f2e668..fe2dde3 100644 --- a/noncore/multimedia/opieplayer3/playlist.cpp +++ b/noncore/multimedia/opieplayer3/playlist.cpp @@ -154,25 +154,29 @@ void PlaylistView::addFile(const QString&aFile,const QString&aName) msg += tr("Demuxer failed");
break;
case 4:
msg+=tr("Malformed mrl");
break;
default:
msg += tr("Unknown error");
break;
}
QMessageBox::warning(0,tr("Error reading fileheader"),msg);
return;
}
- m_lastItem = m_items.last();
+ if (m_items.count()>0) {
+ m_lastItem = m_items.last();
+ } else {
+ m_lastItem = 0;
+ }
PlaylistItem*_it = currentItem();
if (m_lastItem) {
m_lastItem = new PlaylistItem(aFile,this,m_lastItem);
} else {
m_lastItem = new PlaylistItem(aFile,this);
}
m_lastItem->setExpandable(false);
m_lastItem->setText(1,name);
QString codec = m_Infolib->metaInfo(6);
if (codec.isEmpty()) {
|