summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-22 17:52:00 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-22 17:52:00 +0100
commitd9bac56f6f75e119631022fcf83a59a11f5d0b26 (patch)
tree8b9d836e61f321a79290fedc6537ce247c68b0a8 /editor
parent78d45fc51c40421683e623ccf8ecce9be9143631 (diff)
parent82f06542a507a990b168fe6c7f9ba605ab414d56 (diff)
Merge pull request #71859 from KoBeWi/nullptr.is_class()
Fix potential crash in EditorPlugin.edit()
Diffstat (limited to 'editor')
-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);