File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/Files.App/UserControls Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments