Skip to content

Commit

Permalink
Fixed Guid checks
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinvanhunen committed Dec 8, 2022
1 parent 14b8455 commit 791b031
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Commands/Fields/AddField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected override void ExecuteCmdlet()
fieldCI.FieldOptions |= AddFieldOptions.AddToAllContentTypes;
}

if (ClientSideComponentId != null)
if (ClientSideComponentId != Guid.Empty)
{
fieldCI.ClientSideComponentId = ClientSideComponentId;
}
Expand Down Expand Up @@ -223,7 +223,7 @@ protected override void ExecuteCmdlet()
AddToDefaultView = AddToDefaultView
};

if (ClientSideComponentId != null)
if (ClientSideComponentId != Guid.Empty)
{
fieldCI.ClientSideComponentId = ClientSideComponentId;
}
Expand Down
7 changes: 1 addition & 6 deletions src/Commands/Lists/GetListItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected override void ExecuteCmdlet()
ClientContext.ExecuteQueryRetry();
WriteObject(listItem);
}
else if (HasUniqueId())
else if (UniqueId != Guid.Empty)
{
CamlQuery query = new CamlQuery();
var viewFieldsStringBuilder = new StringBuilder();
Expand Down Expand Up @@ -180,11 +180,6 @@ private bool HasId()
return Id != -1;
}

private bool HasUniqueId()
{
return UniqueId != null && UniqueId != Guid.Empty;
}

private bool HasCamlQuery()
{
return Query != null;
Expand Down

0 comments on commit 791b031

Please sign in to comment.