Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
KoenZomers committed Sep 2, 2023
1 parent a599220 commit 7d07649
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Commands/Taxonomy/SetTerm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class SetTerm : PnPRetrievalsCmdlet<Term>
public bool Deprecated;

[Parameter(Mandatory = false)]
public bool AvailableForTagging;
public bool? AvailableForTagging;

protected override void ExecuteCmdlet()
{
Expand Down Expand Up @@ -134,9 +134,9 @@ protected override void ExecuteCmdlet()
term.Deprecate(Deprecated);
}

if (ParameterSpecified(nameof(AvailableForTagging)))
if (ParameterSpecified(nameof(AvailableForTagging)) && AvailableForTagging.HasValue)
{
term.IsAvailableForTagging = AvailableForTagging;
term.IsAvailableForTagging = AvailableForTagging.Value;
}

ClientContext.Load(term);
Expand All @@ -145,5 +145,4 @@ protected override void ExecuteCmdlet()
WriteObject(term);
}
}
}

}

0 comments on commit 7d07649

Please sign in to comment.