Skip to content

Commit 791b031

Browse files
committed
Fixed Guid checks
1 parent 14b8455 commit 791b031

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/Commands/Fields/AddField.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected override void ExecuteCmdlet()
112112
fieldCI.FieldOptions |= AddFieldOptions.AddToAllContentTypes;
113113
}
114114

115-
if (ClientSideComponentId != null)
115+
if (ClientSideComponentId != Guid.Empty)
116116
{
117117
fieldCI.ClientSideComponentId = ClientSideComponentId;
118118
}
@@ -223,7 +223,7 @@ protected override void ExecuteCmdlet()
223223
AddToDefaultView = AddToDefaultView
224224
};
225225

226-
if (ClientSideComponentId != null)
226+
if (ClientSideComponentId != Guid.Empty)
227227
{
228228
fieldCI.ClientSideComponentId = ClientSideComponentId;
229229
}

src/Commands/Lists/GetListItem.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected override void ExecuteCmdlet()
7979
ClientContext.ExecuteQueryRetry();
8080
WriteObject(listItem);
8181
}
82-
else if (HasUniqueId())
82+
else if (UniqueId != Guid.Empty)
8383
{
8484
CamlQuery query = new CamlQuery();
8585
var viewFieldsStringBuilder = new StringBuilder();
@@ -180,11 +180,6 @@ private bool HasId()
180180
return Id != -1;
181181
}
182182

183-
private bool HasUniqueId()
184-
{
185-
return UniqueId != null && UniqueId != Guid.Empty;
186-
}
187-
188183
private bool HasCamlQuery()
189184
{
190185
return Query != null;

0 commit comments

Comments
 (0)