From fa000c6327d5ceb4ff7ab23c2215ab801631de6b Mon Sep 17 00:00:00 2001 From: George Marques Date: Fri, 17 Nov 2017 20:54:35 -0200 Subject: [PATCH] Fix build error caused by cherry-pick from 3.0 Problematic commit: 5e4f092ac --- editor/editor_plugin.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 5b501ae6438..e14c5cc4fec 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -176,8 +176,9 @@ void EditorPlugin::make_visible(bool p_visible) { void EditorPlugin::edit(Object *p_object) { if (get_script_instance() && get_script_instance()->has_method("edit")) { - if (p_object->is_class("Resource")) { - get_script_instance()->call("edit", Ref(Object::cast_to(p_object))); + Resource *obj = p_object ? p_object->cast_to() : NULL; + if (obj) { + get_script_instance()->call("edit", Ref(obj)); } else { get_script_instance()->call("edit", p_object); }