Preserve null custom attributes

This commit is contained in:
GriffinR 2022-10-29 17:16:52 -04:00
parent 16926144da
commit 01cbb52341

View file

@ -311,7 +311,6 @@ const Json & JsonArray::operator[] (int i) const {
const Json Json::fromQJsonValue(QJsonValue value) { const Json Json::fromQJsonValue(QJsonValue value) {
switch (value.type()) switch (value.type())
{ {
default:
case QJsonValue::String: return value.toString(); case QJsonValue::String: return value.toString();
case QJsonValue::Double: return value.toInt(); case QJsonValue::Double: return value.toInt();
case QJsonValue::Bool: return value.toBool(); case QJsonValue::Bool: return value.toBool();
@ -331,6 +330,7 @@ const Json Json::fromQJsonValue(QJsonValue value) {
obj[it.key()] = Json::fromQJsonValue(it.value()); obj[it.key()] = Json::fromQJsonValue(it.value());
return obj; return obj;
} }
default: return static_null();
} }
} }