fix crash on null class in ClassDB.get_property() and set_property()

(cherry picked from commit 400843c172)
This commit is contained in:
jmb462 2021-04-02 20:05:01 +02:00 committed by Rémi Verschelde
parent d844e72157
commit ce4dec647c
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 0 deletions

View File

@ -1018,6 +1018,7 @@ void ClassDB::get_property_list(StringName p_class, List<PropertyInfo> *p_list,
}
}
bool ClassDB::set_property(Object *p_object, const StringName &p_property, const Variant &p_value, bool *r_valid) {
ERR_FAIL_NULL_V(p_object, false);
ClassInfo *type = classes.getptr(p_object->get_class_name());
ClassInfo *check = type;
@ -1064,6 +1065,7 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const
return false;
}
bool ClassDB::get_property(Object *p_object, const StringName &p_property, Variant &r_value) {
ERR_FAIL_NULL_V(p_object, false);
ClassInfo *type = classes.getptr(p_object->get_class_name());
ClassInfo *check = type;