Check for empty string in CutterCore::cmdj()

This commit is contained in:
Florian Märkl 2017-11-25 15:15:58 +01:00
parent b0137892cd
commit be54694877

View File

@ -206,6 +206,12 @@ QJsonDocument CutterCore::cmdj(const QString &str)
QString resString = QString(res);
if (resString.isEmpty())
{
r_mem_free(res);
return QJsonDocument();
}
QJsonParseError jsonError;
QJsonDocument doc = res ? QJsonDocument::fromJson(resString.toUtf8(), &jsonError) : QJsonDocument();