summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@gmail.com>2016-12-05 17:24:50 +0100
committerTobias Hunger <tobias.hunger@qt.io>2016-12-07 08:40:05 +0000
commit1f8772698017875e75219109d2849e79ab84e1c7 (patch)
tree40996f204ad6129c0e53b6b2ee9f5a2f80df19df
parent3c159957f863cf8d367a9261e7016e52cd0348c1 (diff)
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>
-rw-r--r--src/corelib/mimetypes/qmimetypeparser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/mimetypes/qmimetypeparser.cpp b/src/corelib/mimetypes/qmimetypeparser.cpp
index 7693055cc1..20b4461b03 100644
--- a/src/corelib/mimetypes/qmimetypeparser.cpp
+++ b/src/corelib/mimetypes/qmimetypeparser.cpp
@@ -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;