Fix Ref(Variant) constructor to properly check the object type

Otherwise it was saving any reference as valid, regardless of type.
This commit is contained in:
George Marques 2020-02-19 10:52:32 -03:00
parent b967c910b8
commit cb0b5eae8c
No known key found for this signature in database
GPG Key ID: 046BD46A3201E43D
1 changed files with 4 additions and 4 deletions

View File

@ -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;
}