summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scene/debugger/scene_debugger.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp
index 9b9f0455a1..22ff0611a7 100644
--- a/scene/debugger/scene_debugger.cpp
+++ b/scene/debugger/scene_debugger.cpp
@@ -347,13 +347,17 @@ void SceneDebuggerObject::serialize(Array &r_arr, int p_max_size) {
const PropertyInfo &pi = properties[i].first;
Variant &var = properties[i].second;
- WeakRef *ref = Object::cast_to<WeakRef>(var);
- if (ref) {
- var = ref->get_ref();
- }
-
RES res = var;
+ if (var.get_type() == Variant::OBJECT && var.is_ref()) {
+ REF r = var;
+ if (r.is_valid()) {
+ res = *r;
+ } else {
+ res = RES();
+ }
+ }
+
Array prop;
prop.push_back(pi.name);
prop.push_back(pi.type);