Merge pull request #794 from DNKpp/master
Object::cast_to checks provided object for nullptrpull/797/head
commit
dcd4460c88
|
@ -169,6 +169,9 @@ public:
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
T *Object::cast_to(Object *p_object) {
|
T *Object::cast_to(Object *p_object) {
|
||||||
|
if (p_object == nullptr) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
GDNativeObjectPtr casted = internal::gdn_interface->object_cast_to(p_object->_owner, internal::gdn_interface->classdb_get_class_tag(T::get_class_static()));
|
GDNativeObjectPtr casted = internal::gdn_interface->object_cast_to(p_object->_owner, internal::gdn_interface->classdb_get_class_tag(T::get_class_static()));
|
||||||
if (casted == nullptr) {
|
if (casted == nullptr) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Reference in New Issue