Skip to content

Commit f4215d8

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 0535e07 commit f4215d8

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
@@ -311,7 +311,7 @@ private void UpdateEnvironmentVariables(IDictionary<string, string> secrets)
311311
{
312312
Environment.SetEnvironmentVariable(secret.Key, secret.Value, EnvironmentVariableTarget.Process);
313313
}
314-
else if (secret.Value == string.Empty)
314+
else if (!string.IsNullOrEmpty(secret.Key) && secret.Value == string.Empty)
315315
{
316316
EnvironmentNativeMethods.SetEnvironmentVariable(secret.Key, secret.Value);
317317
}

0 commit comments

Comments
 (0)