Browse Source

Merge pull request #30935 from YeldhamDev/gdnative_plugin_fix

Fix 'GDNativeLibrary' editor being incorrectly opened
Rémi Verschelde 6 years ago
parent
commit
adffd9aaef
1 changed files with 3 additions and 5 deletions
  1. 3 5
      modules/gdnative/gdnative_library_editor_plugin.cpp

+ 3 - 5
modules/gdnative/gdnative_library_editor_plugin.cpp

@@ -396,11 +396,9 @@ GDNativeLibraryEditor::GDNativeLibraryEditor() {
 
 
 void GDNativeLibraryEditorPlugin::edit(Object *p_node) {
 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 {
 bool GDNativeLibraryEditorPlugin::handles(Object *p_node) const {