Skip to content

Commit 3576d17

Browse files
authored
Fix: Fixed NullReferenceException in OpenDirectoryInNewTabAction (#13769)
1 parent f07d32e commit 3576d17

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Files.App/Actions/Navigation/OpenDirectoryInNewTabAction.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public RichGlyph Glyph
2121
=> new(opacityStyle: "ColorIconOpenInNewTab");
2222

2323
public bool IsExecutable =>
24+
context.ShellPage is not null &&
25+
context.ShellPage.SlimContentPage is not null &&
2426
context.SelectedItems.Count <= 5 &&
2527
context.SelectedItems.Where(x => x.IsFolder == true).Count() == context.SelectedItems.Count &&
2628
userSettingsService.GeneralSettingsService.ShowOpenInNewTab;
@@ -36,6 +38,9 @@ public OpenDirectoryInNewTabAction()
3638

3739
public async Task ExecuteAsync()
3840
{
41+
if (context.ShellPage?.SlimContentPage?.SelectedItems is null)
42+
return;
43+
3944
foreach (ListedItem listedItem in context.ShellPage.SlimContentPage.SelectedItems)
4045
{
4146
await MainWindow.Instance.DispatcherQueue.EnqueueOrInvokeAsync(async () =>

0 commit comments

Comments
 (0)