Skip to content

Commit 1fcbe14

Browse files
Fix: Fixed crash when changing tab with one git repository open (#12575)
1 parent 9ba495b commit 1fcbe14

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Files.App/Views/MainPage.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ public void MultitaskingControl_CurrentInstanceChanged(object? sender, CurrentIn
156156
SidebarAdaptiveViewModel.PaneHolder.PropertyChanged += PaneHolder_PropertyChanged;
157157
SidebarAdaptiveViewModel.NotifyInstanceRelatedPropertiesChanged((navArgs as PaneNavigationArguments).LeftPaneNavPathParam);
158158

159+
if (SidebarAdaptiveViewModel.PaneHolder?.ActivePaneOrColumn.SlimContentPage?.DirectoryPropertiesViewModel is not null)
160+
SidebarAdaptiveViewModel.PaneHolder.ActivePaneOrColumn.SlimContentPage.DirectoryPropertiesViewModel.ShowLocals = true;
161+
159162
UpdateStatusBarProperties();
160163
UpdateNavToolbarProperties();
161164
LoadPaneChanged();

src/Files.App/Views/Shells/BaseShellPage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ protected void FilesystemViewModel_GitDirectoryUpdated(object sender, EventArgs
261261
return;
262262

263263
InstanceViewModel.UpdateCurrentBranchName();
264-
ContentPage.DirectoryPropertiesViewModel.UpdateGitInfo(
264+
ContentPage?.DirectoryPropertiesViewModel.UpdateGitInfo(
265265
InstanceViewModel.IsGitRepository,
266266
InstanceViewModel.GitRepositoryPath,
267267
GitHelpers.GetBranchesNames(InstanceViewModel.GitRepositoryPath));

0 commit comments

Comments
 (0)