From 147990cb6dcd6659e1ffd3dd5aa89603ec4806c9 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Mon, 29 Jul 2019 15:05:49 -0300 Subject: [PATCH] Fix 'GDNativeLibrary' editor being incorrectly opened --- modules/gdnative/gdnative_library_editor_plugin.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index e6660971a70..a9980f37930 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -390,11 +390,9 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() { void GDNativeLibraryEditorPlugin::edit(Object *p_node) { - if (Object::cast_to(p_node)) { - library_editor->edit(Object::cast_to(p_node)); - library_editor->show(); - } else - library_editor->hide(); + Ref new_library = Object::cast_to(p_node); + if (new_library.is_valid()) + library_editor->edit(new_library); } bool GDNativeLibraryEditorPlugin::handles(Object *p_node) const {