From 98d5e9ff190085458b54deaad67cb290e068e629 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Fri, 12 Apr 2024 23:15:55 +0900 Subject: [PATCH] Fix: Fixed possible crash when entering characters into path bar (#15160) --- .../UserControls/AddressToolbarViewModel.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs index 087f34dcd72f..3d7eecc66ce4 100644 --- a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs @@ -956,11 +956,13 @@ public async Task SetAddressBarSuggestionsAsync(AutoSuggestBox sender, IShellPag return true; })) { - NavigationBarSuggestions.Clear(); - NavigationBarSuggestions.Add(new NavigationBarSuggestionItem() - { - Text = shellpage.FilesystemViewModel.WorkingDirectory, - PrimaryDisplay = "NavigationToolbarVisiblePathNoResults".GetLocalizedResource() + SafetyExtensions.IgnoreExceptions(() => { + NavigationBarSuggestions.Clear(); + NavigationBarSuggestions.Add(new NavigationBarSuggestionItem() + { + Text = shellpage.FilesystemViewModel.WorkingDirectory, + PrimaryDisplay = "NavigationToolbarVisiblePathNoResults".GetLocalizedResource() + }); }); } }