From 115c59d5e1c1193f3bcda860a7b6b9c9250fefe3 Mon Sep 17 00:00:00 2001 From: josc146 Date: Fri, 7 Jul 2023 13:53:39 +0800 Subject: [PATCH] chore --- backend-golang/wsl.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend-golang/wsl.go b/backend-golang/wsl.go index 29eaba1..d881320 100644 --- a/backend-golang/wsl.go +++ b/backend-golang/wsl.go @@ -119,8 +119,10 @@ func (a *App) WslStop() error { if !running { return errors.New("wsl not running") } - err = cmd.Process.Kill() - cmd = nil + if cmd != nil { + err = cmd.Process.Kill() + cmd = nil + } // stdin.Close() stdin = nil distro = nil