Merge pull request #71859 from KoBeWi/nullptr.is_class()

Fix potential crash in EditorPlugin.edit()
This commit is contained in:
Rémi Verschelde 2023-01-22 17:52:00 +01:00
commit d9bac56f6f
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -662,7 +662,7 @@ void EditorPlugin::make_visible(bool p_visible) {
}
void EditorPlugin::edit(Object *p_object) {
if (p_object->is_class("Resource")) {
if (Object::cast_to<Resource>(p_object)) {
GDVIRTUAL_CALL(_edit, Ref<Resource>(Object::cast_to<Resource>(p_object)));
} else {
GDVIRTUAL_CALL(_edit, p_object);