From cb0b5eae8c1a702987c0def9fd4e658d8cba2946 Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 19 Feb 2020 10:52:32 -0300 Subject: [PATCH] Fix Ref(Variant) constructor to properly check the object type Otherwise it was saving any reference as valid, regardless of type. --- core/reference.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/reference.h b/core/reference.h index b01e0035a77..36e7d5c6a66 100644 --- a/core/reference.h +++ b/core/reference.h @@ -170,9 +170,9 @@ public: return; } - Reference *r = Object::cast_to(object); + T *r = Object::cast_to(object); if (r && r->reference()) { - reference = static_cast(r); + reference = r; } } @@ -226,9 +226,9 @@ public: return; } - Reference *r = Object::cast_to(object); + T *r = Object::cast_to(object); if (r && r->reference()) { - reference = static_cast(r); + reference = r; } else { reference = nullptr; }