summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2020-02-19 10:52:32 -0300
committerGeorge Marques <george@gmarqu.es>2020-02-19 10:58:00 -0300
commitcb0b5eae8c1a702987c0def9fd4e658d8cba2946 (patch)
tree8f939db330f3f49e1af207fd843610eddd8e23f0
parentb967c910b88ed0cf134749464dcec7f4311e19f4 (diff)
Fix Ref(Variant) constructor to properly check the object type
Otherwise it was saving any reference as valid, regardless of type.
-rw-r--r--core/reference.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/reference.h b/core/reference.h
index b01e0035a7..36e7d5c6a6 100644
--- a/core/reference.h
+++ b/core/reference.h
@@ -170,9 +170,9 @@ public:
return;
}
- Reference *r = Object::cast_to<Reference>(object);
+ T *r = Object::cast_to<T>(object);
if (r && r->reference()) {
- reference = static_cast<T *>(r);
+ reference = r;
}
}
@@ -226,9 +226,9 @@ public:
return;
}
- Reference *r = Object::cast_to<Reference>(object);
+ T *r = Object::cast_to<T>(object);
if (r && r->reference()) {
- reference = static_cast<T *>(r);
+ reference = r;
} else {
reference = nullptr;
}