Merge pull request #65323 from timothyqiu/variant-wild

Fix crash when encoding freed object in `ConfigFile`
This commit is contained in:
Rémi Verschelde 2022-09-05 08:27:50 +02:00
commit 9f2e907bac

View File

@ -1680,7 +1680,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
} break;
case Variant::OBJECT: {
Object *obj = p_variant;
Object *obj = p_variant.get_validated_object();
if (!obj) {
p_store_string_func(p_store_string_ud, "null");