PIJSON::print (and toJSON()) now use "null" for unknown type, resulting valid JSON

This commit is contained in:
2026-04-09 14:23:41 +03:00
parent 715d70d930
commit a90c486094
+1 -1
View File
@@ -547,7 +547,7 @@ void PIJSON::print(PIString & s, const PIJSON & v, PIString tab, bool spaces, bo
if (spaces) s += ' '; if (spaces) s += ' ';
} }
switch (v.c_type) { switch (v.c_type) {
case PIJSON::Invalid: break; case PIJSON::Invalid:
case PIJSON::Null: s += "null"; break; case PIJSON::Null: s += "null"; break;
case PIJSON::Boolean: s += PIString::fromBool(v.c_value.toBool()); break; case PIJSON::Boolean: s += PIString::fromBool(v.c_value.toBool()); break;
case PIJSON::Number: s += v.c_value.toString(); break; case PIJSON::Number: s += v.c_value.toString(); break;