Skip to content

Commit ce338f7

Browse files
authored
Fix: Fixed NullReferenceException in DrivesWidgetViewModel.NavigateToPath (#15943)
1 parent 9ad69f9 commit ce338f7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Files.App/ViewModels/UserControls/Widgets/DrivesWidgetViewModel.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,11 @@ public async Task NavigateToPath(string path)
7272
return;
7373
}
7474

75-
ContentPageContext.ShellPage!.NavigateWithArguments(
76-
ContentPageContext.ShellPage!.InstanceViewModel.FolderSettings.GetLayoutType(path),
75+
if (ContentPageContext.ShellPage is not IShellPage shellPage)
76+
return;
77+
78+
shellPage.NavigateWithArguments(
79+
shellPage.InstanceViewModel.FolderSettings.GetLayoutType(path),
7780
new() { NavPathParam = path });
7881
}
7982

0 commit comments

Comments
 (0)