print (none) if no warnings in -getinfo

This commit is contained in:
/dev/fd0 2022-03-22 03:49:01 +05:30
parent e66630cc87
commit 0cea7b10f1

View file

@ -1059,7 +1059,9 @@ static void ParseGetInfoResult(UniValue& result)
result_string += "\n";
}
result_string += strprintf("%sWarnings:%s %s", YELLOW, RESET, result["warnings"].getValStr());
const std::string warnings{result["warnings"].getValStr()};
result_string += strprintf("%sWarnings:%s %s", YELLOW, RESET, warnings.empty() ? "(none)" : warnings);
result.setStr(result_string);
}