Explorar o código

Fix potential crash in EditorPlugin.edit()

kobewi %!s(int64=2) %!d(string=hai) anos
pai
achega
82f06542a5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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) {
 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)));
 		GDVIRTUAL_CALL(_edit, Ref<Resource>(Object::cast_to<Resource>(p_object)));
 	} else {
 	} else {
 		GDVIRTUAL_CALL(_edit, p_object);
 		GDVIRTUAL_CALL(_edit, p_object);