fix for crash when tabbing with no selected item

This commit is contained in:
ryanbodrug-microsoft
2020-05-03 14:45:44 -07:00
parent c4f884f104
commit 1655594514

View File

@@ -165,7 +165,8 @@ namespace Wox.ViewModel
public void SelectNextTabItem() 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(); SelectNextResult();
} }
@@ -173,7 +174,8 @@ namespace Wox.ViewModel
public void SelectPrevTabItem() 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 //Tabbing backwards should highlight the last item of the previous row
SelectPrevResult(); SelectPrevResult();