From 1655594514e30f9309f63213249ea9d6f0f8579d Mon Sep 17 00:00:00 2001 From: ryanbodrug-microsoft <56318517+ryanbodrug-microsoft@users.noreply.github.com> Date: Sun, 3 May 2020 14:45:44 -0700 Subject: [PATCH] fix for crash when tabbing with no selected item --- src/modules/launcher/Wox/ViewModel/ResultsViewModel.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/launcher/Wox/ViewModel/ResultsViewModel.cs b/src/modules/launcher/Wox/ViewModel/ResultsViewModel.cs index a45752fb41..14ac524b58 100644 --- a/src/modules/launcher/Wox/ViewModel/ResultsViewModel.cs +++ b/src/modules/launcher/Wox/ViewModel/ResultsViewModel.cs @@ -165,7 +165,8 @@ namespace Wox.ViewModel public void SelectNextTabItem() { - if(!SelectedItem.SelectNextContextButton()) + //Do nothing if there is no selected item or we've selected the next context button + if(!SelectedItem?.SelectNextContextButton() ?? true) { SelectNextResult(); } @@ -173,7 +174,8 @@ namespace Wox.ViewModel public void SelectPrevTabItem() { - if (!SelectedItem.SelectPrevContextButton()) + //Do nothing if there is no selected item or we've selected the previous context button + if (!SelectedItem?.SelectPrevContextButton() ?? true) { //Tabbing backwards should highlight the last item of the previous row SelectPrevResult();