Skip to content

Commit dcdaf4e

Browse files
committed
Update
1 parent 9ab845f commit dcdaf4e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Files.App/UserControls/NavigationToolbar.xaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,13 @@ await DialogDisplayHelper.ShowDialogAsync(Strings.InvalidCommand.GetLocalizedRes
309309
}
310310
else if (Omnibar.CurrentSelectedMode == OmnibarSearchMode)
311311
{
312-
var shellPage = ContentPageContext.ShellPage;
312+
if (ContentPageContext.ShellPage is not { } shellPage)
313+
return;
313314

314-
if (args.Item is SuggestionModel item && !string.IsNullOrWhiteSpace(item.ItemPath) && shellPage is not null)
315+
if (args.Item is SuggestionModel item && !string.IsNullOrWhiteSpace(item.ItemPath))
316+
{
315317
await NavigationHelpers.OpenPath(item.ItemPath, shellPage);
318+
}
316319
else
317320
{
318321
var searchQuery = args.Item is SuggestionModel x && !string.IsNullOrWhiteSpace(x.Name)
@@ -324,6 +327,7 @@ await DialogDisplayHelper.ShowDialogAsync(Strings.InvalidCommand.GetLocalizedRes
324327
}
325328

326329
(MainPageViewModel.SelectedTabItem?.TabItemContent as Control)?.Focus(FocusState.Programmatic);
330+
327331
return;
328332
}
329333
}

0 commit comments

Comments
 (0)