MimeTypeParser: Make sure errorMessage is set
Other methods that call this method check for errorMessage to be nullptr, so better check here, too. Change-Id: I8cf4e9d4f5eaafcfc8309dc351ae3b7027c40a98 Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
3c159957f8
commit
1f87726980
@ -165,7 +165,8 @@ bool QMimeTypeParserBase::parseNumber(const QStringRef &n, int *target, QString
|
||||
bool ok;
|
||||
*target = n.toInt(&ok);
|
||||
if (Q_UNLIKELY(!ok)) {
|
||||
*errorMessage = QLatin1String("Not a number '") + n + QLatin1String("'.");
|
||||
if (errorMessage)
|
||||
*errorMessage = QLatin1String("Not a number '") + n + QLatin1String("'.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user