Don't try to access the string list if the item type is a locator.

Allan, does this look correct?  (It at least fixes the crash...)

BUG:169810
CCMAIL:kde@carewolf.com


git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@852712 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2008-08-26 12:19:47 +00:00
parent d2a1cfa32d
commit 13fddc3974

View File

@ -160,14 +160,14 @@ String APE::Item::toString() const
bool APE::Item::isEmpty() const
{
switch(d->type) {
case 0:
case 1:
case Text:
case Binary:
if(d->text.isEmpty())
return true;
if(d->text.size() == 1 && d->text.front().isEmpty())
return true;
return false;
case 2:
case Locator:
return d->value.isEmpty();
default:
return false;
@ -206,8 +206,9 @@ ByteVector APE::Item::render() const
if(isEmpty())
return data;
if(d->type != Item::Binary) {
if(d->type == Text) {
StringList::ConstIterator it = d->text.begin();
value.append(it->data(String::UTF8));
it++;
for(; it != d->text.end(); ++it) {