diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-09-04 19:56:37 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-09-04 19:56:37 +0800 |
commit | 3c0759608a1da37d7ef8a40ffbb242501e06a8a2 (patch) | |
tree | e04907bfbcb3944fb7463128bad017254f315404 | |
parent | b6d102c7c2d5e9f39f368bf1ebc91a48bf762c42 (diff) |
Fix crash when encoding freed object in ConfigFile
-rw-r--r-- | core/variant/variant_parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp index 34653310b1..8151ff2102 100644 --- a/core/variant/variant_parser.cpp +++ b/core/variant/variant_parser.cpp @@ -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"); |