From 8d040655bbfabb056b7dc83d50ca65c4ac6e3119 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Tue, 2 May 2023 17:45:29 +0000 Subject: [PATCH] Silence critical warning on startup (#2182) --- src/View/Window.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/View/Window.vala b/src/View/Window.vala index 0aa97c0ee..f96fad822 100644 --- a/src/View/Window.vala +++ b/src/View/Window.vala @@ -344,7 +344,9 @@ namespace Files.View { }); tabs.tab_switched.connect ((old_tab, new_tab) => { - change_tab (tabs.get_tab_position (new_tab)); + if (new_tab != null) { + change_tab (tabs.get_tab_position (new_tab)); + } }); tabs.tab_restored.connect ((label, restore_data, icon) => { @@ -1052,7 +1054,9 @@ namespace Files.View { } private void save_active_tab_position () { - Files.app_settings.set_int ("active-tab-position", tabs.get_tab_position (tabs.current)); + if (tabs.current != null) { + Files.app_settings.set_int ("active-tab-position", tabs.get_tab_position (tabs.current)); + } } public uint restore_tabs () {