Skip to content

Commit 81c5d1d

Browse files
committed
FolderRelativeUrl BugFix when empty value
1 parent 84f36dd commit 81c5d1d

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/NovaPointLibrary/Commands/SharePoint/Item/SPOItemsParameters.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public string FolderRelativeUrl
2121
get { return _folderRelativeUrl; }
2222
set
2323
{
24-
if (value.StartsWith("/")) { _folderRelativeUrl = value.Trim(); }
24+
if ( String.IsNullOrWhiteSpace(value)) { _folderRelativeUrl = value.Trim(); }
25+
else if (value.StartsWith("/")) { _folderRelativeUrl = value.Trim(); }
2526
else { _folderRelativeUrl = "/" + value.Trim(); }
2627
}
2728
}

src/NovaPointLibrary/Commands/SharePoint/Item/SPOTenantItemsCSOM.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,22 @@ internal async IAsyncEnumerable<SPOTenantItemRecord> GetAsync()
6262
continue;
6363
}
6464

65+
//if (String.IsNullOrEmpty(_param.ItemsParam.FolderRelativeUrl))
66+
//{
67+
// LongListNotification(recordList.List);
68+
//}
69+
70+
CamlQuery camlQuery = CamlQuery.CreateAllItemsQuery();
71+
6572
if (String.IsNullOrEmpty(_param.ItemsParam.FolderRelativeUrl))
6673
{
6774
LongListNotification(recordList.List);
6875
}
76+
else
77+
{
78+
camlQuery.FolderServerRelativeUrl = _param.ItemsParam.FolderRelativeUrl;
79+
}
6980

70-
CamlQuery camlQuery = CamlQuery.CreateAllItemsQuery();
71-
camlQuery.FolderServerRelativeUrl = _param.ItemsParam.FolderRelativeUrl;
7281

7382
var queryElement = XElement.Parse(camlQuery.ViewXml);
7483

0 commit comments

Comments
 (0)