refs #815 Throw CJsonException when required JSON objects are not found.

This commit is contained in:
Mathew Sutcliffe
2016-12-18 04:44:25 +00:00
parent 7c5c9d30e6
commit bbdbd26f82
10 changed files with 112 additions and 40 deletions

View File

@@ -194,8 +194,9 @@ namespace BlackMisc
void CUrl::convertFromJson(const QJsonObject &json)
{
QString url(json.value("url").toString());
this->setFullUrl(url);
const QJsonValue value = json.value("url");
if (value.isUndefined()) { throw CJsonException("Missing 'url'"); }
this->setFullUrl(value.toString());
}
int CUrl::protocolToDefaultPort(const QString &protocol)