Skip to content

Commit c38225f

Browse files
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 03232bd commit c38225f

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
@@ -218,7 +218,7 @@ private void UpdateEnvironmentVariables(IDictionary<string, string> secrets)
218218
{
219219
Environment.SetEnvironmentVariable(secret.Key, secret.Value, EnvironmentVariableTarget.Process);
220220
}
221-
else if (secret.Value == string.Empty)
221+
else if (!string.IsNullOrEmpty(secret.Key) && secret.Value == string.Empty)
222222
{
223223
EnvironmentNativeMethods.SetEnvironmentVariable(secret.Key, secret.Value);
224224
}

0 commit comments

Comments
 (0)