From df40c2722e4a41e01cf326353e2583ae82ccc9a4 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sat, 2 Jan 2021 20:05:54 -0600 Subject: Fix TryGetNextNonSwitchArgumentOrError. --- src/WixToolset.Core/CommandLine/BuildCommand.cs | 2 +- src/WixToolset.Core/CommandLine/CommandLineParser.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/WixToolset.Core/CommandLine') diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 072accc3..fed95958 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs @@ -578,7 +578,7 @@ namespace WixToolset.Core.CommandLine case "bindpath": { var value = parser.GetNextArgumentOrError(arg); - if (this.TryParseBindPath(value, out var bindPath)) + if (value != null && this.TryParseBindPath(value, out var bindPath)) { this.BindPaths.Add(bindPath); return true; diff --git a/src/WixToolset.Core/CommandLine/CommandLineParser.cs b/src/WixToolset.Core/CommandLine/CommandLineParser.cs index 1438d820..e78da47e 100644 --- a/src/WixToolset.Core/CommandLine/CommandLineParser.cs +++ b/src/WixToolset.Core/CommandLine/CommandLineParser.cs @@ -138,9 +138,10 @@ namespace WixToolset.Core.CommandLine { var result = this.TryGetNextSwitchOrArgument(out arg); - if (!result && !this.IsSwitch(arg)) + if (!result || this.IsSwitch(arg)) { this.ErrorArgument = arg ?? CommandLineParser.ExpectedArgument; + return false; } return result; -- cgit v1.2.3-55-g6feb