Don't add partial objects when allocation fails

Fixes #2081
This commit is contained in:
Benoit Blanchon
2024-05-23 18:36:24 +02:00
parent f99b2d63f9
commit 5a60c55be7
13 changed files with 213 additions and 19 deletions

View File

@ -118,7 +118,7 @@ TEST_CASE("JsonObject::set()") {
bool success = obj3.set(obj1);
REQUIRE(success == false);
REQUIRE(doc3.as<std::string>() == "{\"hello\":[null]}");
REQUIRE(doc3.as<std::string>() == "{\"hello\":[]}");
}
SECTION("destination is null") {