Skip to content

Commit 742cf22

Browse files
committed
Fix potential crash when ActionRuntime is null
1 parent f0db3e4 commit 742cf22

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Files.App/ViewModels/UserControls/NavigationToolbarViewModel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,10 @@ public void PopulateOmnibarSuggestionsForCommandPaletteMode()
12031203
OmnibarCommandPaletteModeText ??= string.Empty;
12041204
OmnibarCommandPaletteModeSuggestionItems.Clear();
12051205

1206-
if (ContentPageContext.SelectedItems.Count == 1 && ContentPageContext.SelectedItem is not null && !ContentPageContext.SelectedItem.IsFolder)
1206+
if (ActionManager.Instance.ActionRuntime is not null &&
1207+
ContentPageContext.SelectedItems.Count == 1 &&
1208+
ContentPageContext.SelectedItem is not null &&
1209+
!ContentPageContext.SelectedItem.IsFolder)
12071210
{
12081211
var dispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
12091212

0 commit comments

Comments
 (0)