File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/Files.App/ViewModels/UserControls Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -942,8 +942,14 @@ public async Task PopulateOmnibarSuggestionsForPathMode()
942
942
void AddNoResultsItem ( )
943
943
{
944
944
PathModeSuggestionItems . Clear ( ) ;
945
+
946
+ // Use null-safe access to avoid NullReferenceException during app lifecycle transitions
947
+ var workingDirectory = string . IsNullOrEmpty ( ContentPageContext . ShellPage ? . ShellViewModel ? . WorkingDirectory )
948
+ ? Constants . UserEnvironmentPaths . HomePath
949
+ : ContentPageContext . ShellPage . ShellViewModel . WorkingDirectory ;
950
+
945
951
PathModeSuggestionItems . Add ( new (
946
- ContentPageContext . ShellPage . ShellViewModel . WorkingDirectory ,
952
+ workingDirectory ,
947
953
Strings . NavigationToolbarVisiblePathNoResults . GetLocalizedResource ( ) ) ) ;
948
954
}
949
955
}
You can’t perform that action at this time.
0 commit comments