Skip to content

Commit 121754f

Browse files
fredrikhrjonsequitur
authored andcommitted
Add brances in if-check for environment variables
1 parent a7cc2ee commit 121754f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/System.CommandLine/Builder/CommandLineBuilderExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ public static CommandLineBuilder UseEnvironmentVariableDirective(
240240
var components = envDirective.Split(new[] { '=' }, count: 2);
241241
var variable = components.Length > 0 ? components[0].Trim() : string.Empty;
242242
if (string.IsNullOrEmpty(variable) || components.Length < 2)
243+
{
243244
continue;
245+
}
244246
var value = components[1].Trim();
245247
SetEnvironmentVariable(variable, value);
246248
}

0 commit comments

Comments
 (0)