From d95e34b026a7c9db11f48479f03bc84a03694a1d Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Fri, 25 Jun 2021 10:24:33 +0530 Subject: [PATCH] Issue #2433 check if tray is running before attempting to kill during cleanup --- pkg/crc/preflight/preflight_checks_tray_windows.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/crc/preflight/preflight_checks_tray_windows.go b/pkg/crc/preflight/preflight_checks_tray_windows.go index 98f0a2b189..0cc7856c60 100644 --- a/pkg/crc/preflight/preflight_checks_tray_windows.go +++ b/pkg/crc/preflight/preflight_checks_tray_windows.go @@ -31,7 +31,9 @@ func stopTray() error { * this tries to stop the old tray process, can be removed after a few releases */ _, _, _ = powershell.Execute(`Stop-Process -Name tray-windows`) - + if err := checkIfTrayRunning(); err != nil { + return nil + } trayProcessName := strings.TrimSuffix(constants.TrayExecutableName, ".exe") cmd := fmt.Sprintf(`Stop-Process -Name "%s"`, trayProcessName) if _, _, err := powershell.Execute(cmd); err != nil {