Skip to content

Commit 87b6238

Browse files
TroyWitthoeftahmelsayed
authored andcommitted
Update StartHost.cs (#1735)
Fixing issue #1732 Updating the else if block to skip attempting to set the environmental variable when both the var and it's value are blank or null. Co-authored-by: Ahmed ElSayed <[email protected]>
1 parent ae54a31 commit 87b6238

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Azure.Functions.Cli/Actions/HostActions/StartHostAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ private void UpdateEnvironmentVariables(IDictionary<string, string> secrets)
317317
{
318318
Environment.SetEnvironmentVariable(secret.Key, secret.Value, EnvironmentVariableTarget.Process);
319319
}
320-
else if (secret.Value == string.Empty)
320+
else if (!string.IsNullOrEmpty(secret.Key) && secret.Value == string.Empty)
321321
{
322322
EnvironmentNativeMethods.SetEnvironmentVariable(secret.Key, secret.Value);
323323
}

0 commit comments

Comments
 (0)