From 35ebd4a0a19eeac2b047da6d8b2815fae911193d Mon Sep 17 00:00:00 2001 From: NextTurn <45985406+NextTurn@users.noreply.github.com> Date: Sun, 2 Aug 2020 00:00:00 +0800 Subject: [PATCH] Allow `` without arguments --- src/WinSW/WrapperService.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/WinSW/WrapperService.cs b/src/WinSW/WrapperService.cs index ae71a5e..37801df 100644 --- a/src/WinSW/WrapperService.cs +++ b/src/WinSW/WrapperService.cs @@ -361,11 +361,12 @@ namespace WinSW } } - string? stopArguments = this.config.StopArguments; this.LogInfo("Stopping " + this.config.Id); this.orderlyShutdown = true; - if (stopArguments is null) + string? stopExecutable = this.config.StopExecutable; + string? stopArguments = this.config.StopArguments; + if (stopExecutable is null && stopArguments is null) { Log.Debug("ProcessKill " + this.process.Id); this.process.StopTree(this.config.StopTimeout); @@ -375,7 +376,7 @@ namespace WinSW { this.SignalPending(); - string stopExecutable = this.config.StopExecutable ?? this.config.Executable; + stopExecutable ??= this.config.Executable; try {