summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2019-07-29 15:05:49 -0300
committerMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2019-07-29 15:05:49 -0300
commit147990cb6dcd6659e1ffd3dd5aa89603ec4806c9 (patch)
tree7b45187beb425c7cd1f9ddfd95e61b3274504a3e
parentcc0e5e51b816cadcbf4ae3f909d35c783a71d3d5 (diff)
Fix 'GDNativeLibrary' editor being incorrectly opened
-rw-r--r--modules/gdnative/gdnative_library_editor_plugin.cpp8
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 {