Commit 019f6512 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

CDDB::statusCode: Don't crash if tokenlist is empty

BUGS: 424646
parent b2cba08c
...@@ -104,14 +104,15 @@ namespace KCDDB ...@@ -104,14 +104,15 @@ namespace KCDDB
CDDB::statusCode( const QString & line ) CDDB::statusCode( const QString & line )
{ {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList tokenList = line.split(QLatin1Char( ' ' ), QString::SkipEmptyParts ); const QStringList tokenList = line.split(QLatin1Char( ' ' ), QString::SkipEmptyParts );
#else #else
QStringList tokenList = line.split(QLatin1Char( ' ' ), Qt::SkipEmptyParts ); const QStringList tokenList = line.split(QLatin1Char( ' ' ), Qt::SkipEmptyParts );
#endif #endif
uint serverStatus = tokenList[ 0 ].toUInt(); if (tokenList.isEmpty())
return 410;
return serverStatus; return tokenList[ 0 ].toUInt();
} }
CDInfoList CDInfoList
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment