Codeflow cleanup when selectedItem is not null

This commit is contained in:
Divyansh Srivastava 2020-04-23 14:22:19 -07:00
parent d0822ab1fe
commit 92daf156f5

View File

@ -155,11 +155,11 @@ namespace Wox.ViewModel
if(results.SelectedItem != null)
{
//If there is a context button selected fire the action for that button before the main command.
bool didExecuteContextButton = results.SelectedItem?.ExecuteSelectedContextButton() ?? false;
bool didExecuteContextButton = results.SelectedItem.ExecuteSelectedContextButton();
if (!didExecuteContextButton)
{
var result = results.SelectedItem?.Result;
var result = results.SelectedItem.Result;
if (result != null) // SelectedItem returns null if selection is empty.
{
bool hideWindow = result.Action != null && result.Action(new ActionContext