diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 56718a2caf9..2e93291c03b 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -410,7 +410,10 @@ void VersionControlEditorPlugin::_refresh_stage_area() { int total_changes = status_files.size(); String commit_tab_title = TTR("Commit") + (total_changes > 0 ? " (" + itos(total_changes) + ")" : ""); - dock_vbc->set_tab_title(version_commit_dock->get_index(), commit_tab_title); + TabContainer *dock_vbc = Object::cast_to(version_commit_dock->get_parent_control()); + if (dock_vbc) { + dock_vbc->set_tab_title(version_commit_dock->get_index(), commit_tab_title); + } } void VersionControlEditorPlugin::_discard_file(String p_file_path, EditorVCSInterface::ChangeType p_change) { @@ -932,7 +935,7 @@ void VersionControlEditorPlugin::_commit_message_gui_input(const Ref void VersionControlEditorPlugin::register_editor() { EditorNode::get_singleton()->add_control_to_dock(EditorNode::DOCK_SLOT_RIGHT_UL, version_commit_dock); - dock_vbc = (TabContainer *)version_commit_dock->get_parent_control(); + TabContainer *dock_vbc = Object::cast_to(version_commit_dock->get_parent_control()); dock_vbc->set_tab_title(version_commit_dock->get_index(), TTR("Commit")); ToolButton *vc = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Version Control"), version_control_dock); diff --git a/editor/plugins/version_control_editor_plugin.h b/editor/plugins/version_control_editor_plugin.h index 16fda23387a..c93e78de546 100644 --- a/editor/plugins/version_control_editor_plugin.h +++ b/editor/plugins/version_control_editor_plugin.h @@ -98,7 +98,6 @@ private: HashMap change_type_to_color; HashMap> change_type_to_icon; - TabContainer *dock_vbc; VBoxContainer *version_commit_dock; Tree *staged_files; Tree *unstaged_files;