Skip to content

Commit

Permalink
#1216 : Fix issue where the Email gets wiped out.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellwest committed Oct 10, 2020
1 parent 05d6038 commit 2661177
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Spe/Commands/Security/Accounts/SetUserCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,36 +93,36 @@ protected override void ProcessRecord()
}

var profile = user.Profile;
if (!string.IsNullOrEmpty(FullName))
if (IsParameterSpecified(nameof(FullName)) && !string.IsNullOrEmpty(FullName))
{
profile.FullName = FullName;
}
if (!string.IsNullOrEmpty(Comment))
if (IsParameterSpecified(nameof(Comment)) && !string.IsNullOrEmpty(Comment))
{
profile.Comment = Comment;
}

if (!string.IsNullOrEmpty(Portrait))
if (IsParameterSpecified(nameof(Portrait)) && !string.IsNullOrEmpty(Portrait))
{
profile.Portrait = Portrait;
}

if (!ID.IsNullOrEmpty(ProfileItemId))
if (IsParameterSpecified(nameof(ProfileItemId)) && !ID.IsNullOrEmpty(ProfileItemId))
{
profile.ProfileItemId = ProfileItemId.ToString();
}

if (profile.Email != Email)
if (IsParameterSpecified(nameof(Email)) && profile.Email != Email)
{
profile.Email = Email;
}

if (User.Current.IsAdministrator && IsParameterSpecified("IsAdministrator"))
if (IsParameterSpecified(nameof(IsAdministrator)) && User.Current.IsAdministrator)
{
profile.IsAdministrator = IsAdministrator;
}

if (!string.IsNullOrEmpty(StartUrl))
if (IsParameterSpecified(nameof(StartUrl)) && !string.IsNullOrEmpty(StartUrl))
{
switch (StartUrl)
{
Expand Down

0 comments on commit 2661177

Please sign in to comment.