浏览代码

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

Fix potential crash in EditorPlugin.edit()
Rémi Verschelde 2 年之前
父节点
当前提交
d9bac56f6f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      editor/editor_plugin.cpp

+ 1 - 1
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);