mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-24 05:45:27 +00:00
Don't print Warnings for whitespace-only JSON Failures (#2579)
This commit is contained in:
parent
3c2b263de7
commit
0229e7ed8b
@ -521,6 +521,10 @@ QJsonDocument CutterCore::parseJson(const char *res, const char *cmd)
|
|||||||
QJsonDocument doc = QJsonDocument::fromJson(json, &jsonError);
|
QJsonDocument doc = QJsonDocument::fromJson(json, &jsonError);
|
||||||
|
|
||||||
if (jsonError.error != QJsonParseError::NoError) {
|
if (jsonError.error != QJsonParseError::NoError) {
|
||||||
|
// don't call trimmed() before knowing that parsing failed to avoid copying huge jsons all the time
|
||||||
|
if (json.trimmed().isEmpty()) {
|
||||||
|
return doc;
|
||||||
|
}
|
||||||
if (cmd) {
|
if (cmd) {
|
||||||
eprintf("Failed to parse JSON for command \"%s\": %s\n", cmd,
|
eprintf("Failed to parse JSON for command \"%s\": %s\n", cmd,
|
||||||
jsonError.errorString().toLocal8Bit().constData());
|
jsonError.errorString().toLocal8Bit().constData());
|
||||||
|
Loading…
Reference in New Issue
Block a user