Skip to content

Commit 0a13812

Browse files
evelyn-bialerickson
authored andcommitted
Fix requiring 'tags' in server response (#1627)
1 parent eb70046 commit 0a13812

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/code/V3ServerAPICalls.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ private FindResults FindNameHelper(string packageName, string[] tags, bool inclu
493493

494494
return new FindResults(stringResponse: Utils.EmptyStrArray, hashtableResponse: emptyHashResponses, responseType: v3FindResponseType);
495495
}
496-
if (!rootDom.TryGetProperty(tagsName, out JsonElement tagsItem))
496+
if (!rootDom.TryGetProperty(tagsName, out JsonElement tagsItem) && tags.Length != 0)
497497
{
498498
errRecord = new ErrorRecord(
499499
new InvalidOrEmptyResponse($"Response does not contain '{tagsName}' element for search with Name '{packageName}' in '{Repository.Name}'."),
@@ -603,7 +603,7 @@ private FindResults FindVersionHelper(string packageName, string version, string
603603

604604
return new FindResults(stringResponse: Utils.EmptyStrArray, hashtableResponse: emptyHashResponses, responseType: v3FindResponseType);
605605
}
606-
if (!rootDom.TryGetProperty(tagsName, out JsonElement tagsItem))
606+
if (!rootDom.TryGetProperty(tagsName, out JsonElement tagsItem) && tags.Length != 0)
607607
{
608608
errRecord = new ErrorRecord(
609609
new InvalidOrEmptyResponse($"Response does not contain '{tagsName}' element for search with name '{packageName}' and version '{version}' in repository '{Repository.Name}'."),

0 commit comments

Comments
 (0)