summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2023-01-22 15:54:42 +0100
committerkobewi <kobewi4e@gmail.com>2023-01-22 15:54:42 +0100
commit82f06542a507a990b168fe6c7f9ba605ab414d56 (patch)
tree91a13ab6456e80b8ed826f5503eadd68509987bf
parentcd031fd31a8fdcdae1e93d1b20caf93230f0ac59 (diff)
Fix potential crash in EditorPlugin.edit()
-rw-r--r--editor/editor_plugin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 7f02148dfc..14cdbc364e 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -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);