From 3cd3c1da5f965d6cc55134ac812a8ea0fd0dcdd7 Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Sat, 26 Aug 2017 17:10:58 +0200 Subject: [PATCH] Fix refactored Object::cast_to in NO_SAFE_CAST branch --- core/object.h | 6 +++--- platform/android/java_class_wrapper.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/object.h b/core/object.h index 88229d27b60..9eb6cd1d569 100644 --- a/core/object.h +++ b/core/object.h @@ -571,8 +571,8 @@ public: #else if (!p_object) return NULL; - if (p_pobject->is_class_ptr(T::get_class_ptr_static())) - return static_cast(p_pobject); + if (p_object->is_class_ptr(T::get_class_ptr_static())) + return static_cast(p_object); else return NULL; #endif @@ -591,7 +591,7 @@ public: #else if (!p_object) return NULL; - if (p_pobject->is_class_ptr(T::get_class_ptr_static())) + if (p_object->is_class_ptr(T::get_class_ptr_static())) return static_cast(p_object); else return NULL; diff --git a/platform/android/java_class_wrapper.cpp b/platform/android/java_class_wrapper.cpp index 5693195bfa0..ffd9150ba49 100644 --- a/platform/android/java_class_wrapper.cpp +++ b/platform/android/java_class_wrapper.cpp @@ -112,7 +112,7 @@ bool JavaClass::_call_method(JavaObject *p_instance, const StringName &p_method, Ref ref = *p_args[i]; if (!ref.is_null()) { - if (Object::cast_to(ref)) { + if (Object::cast_to(ref.ptr())) { Ref jo = ref; //could be faster