From 92daf156f553a042f4c3a5a827e354b9217fa61c Mon Sep 17 00:00:00 2001 From: Divyansh Srivastava Date: Thu, 23 Apr 2020 14:22:19 -0700 Subject: [PATCH] Codeflow cleanup when selectedItem is not null --- src/modules/launcher/Wox/ViewModel/MainViewModel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/launcher/Wox/ViewModel/MainViewModel.cs b/src/modules/launcher/Wox/ViewModel/MainViewModel.cs index eecce22a6f..2e29b60877 100644 --- a/src/modules/launcher/Wox/ViewModel/MainViewModel.cs +++ b/src/modules/launcher/Wox/ViewModel/MainViewModel.cs @@ -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