diff options
author | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-07-29 15:05:49 -0300 |
---|---|---|
committer | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-07-29 15:05:49 -0300 |
commit | 147990cb6dcd6659e1ffd3dd5aa89603ec4806c9 (patch) | |
tree | 7b45187beb425c7cd1f9ddfd95e61b3274504a3e | |
parent | cc0e5e51b816cadcbf4ae3f909d35c783a71d3d5 (diff) |
Fix 'GDNativeLibrary' editor being incorrectly opened
-rw-r--r-- | modules/gdnative/gdnative_library_editor_plugin.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index e6660971a7..a9980f3793 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<GDNativeLibrary>(p_node)) { - library_editor->edit(Object::cast_to<GDNativeLibrary>(p_node)); - library_editor->show(); - } else - library_editor->hide(); + Ref<GDNativeLibrary> new_library = Object::cast_to<GDNativeLibrary>(p_node); + if (new_library.is_valid()) + library_editor->edit(new_library); } bool GDNativeLibraryEditorPlugin::handles(Object *p_node) const { |