diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 601b28a06..219a6a480 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -4694,7 +4694,10 @@ template::value, int> = 0> void to_json(BasicJsonType& j, const CompatibleString& s) { - j.m_value.destroy(j.m_type); + if (!j.is_null()) + { + j = nullptr; + } external_constructor::construct(j, s); }