Skip to content

Commit

Permalink
Fix: Fixed NullReferenceException in CloseTab (#14783)
Browse files Browse the repository at this point in the history
  • Loading branch information
hishitetsu authored and yaira2 committed Feb 21, 2024
1 parent dcba669 commit 7e9e9e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Files.App/UserControls/TabBar/BaseTabBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,11 @@ public async void MoveTabToNewWindowAsync(object sender, RoutedEventArgs e)

public void CloseTab(TabBarItem tabItem)
{
if (tabItem is null)
return;

Items.Remove(tabItem);
tabItem?.Unload();
tabItem.Unload();

// Dispose and save tab arguments
PushRecentTab(new CustomTabViewItemParameter[]
Expand Down

0 comments on commit 7e9e9e6

Please sign in to comment.