diff --git a/resources/share/shared/bootstrap/bootstrap.json b/resources/share/shared/bootstrap/bootstrap.json index 331dec2d1c..eea8dfd348 100644 --- a/resources/share/shared/bootstrap/bootstrap.json +++ b/resources/share/shared/bootstrap/bootstrap.json @@ -71,5 +71,5 @@ } ] }, - "wasLoadedFromFile": false, + "wasLoadedFromFile": false } diff --git a/src/blackmisc/json.cpp b/src/blackmisc/json.cpp index 98c650ec86..f271893401 100644 --- a/src/blackmisc/json.cpp +++ b/src/blackmisc/json.cpp @@ -411,7 +411,14 @@ namespace BlackMisc::Json QJsonObject jsonObjectFromString(const QString &json, bool acceptCacheFormat) { if (json.isEmpty()) { return QJsonObject(); } - const QJsonDocument jsonDoc(QJsonDocument::fromJson(json.toUtf8())); + + QJsonParseError error {}; + const QJsonDocument jsonDoc(QJsonDocument::fromJson(json.toUtf8(), &error)); + if (error.error != QJsonParseError::NoError) + { + throw CJsonException(error.errorString()); + } + return acceptCacheFormat ? Json::unwrapCache(jsonDoc.object()) : jsonDoc.object(); }