Skip to content

Commit 56dfb33

Browse files
authored
Fix requiring 'tags' in server response (#1627)
1 parent 150caac commit 56dfb33

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
@@ -492,7 +492,7 @@ private FindResults FindNameHelper(string packageName, string[] tags, bool inclu
492492

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

603603
return new FindResults(stringResponse: Utils.EmptyStrArray, hashtableResponse: emptyHashResponses, responseType: v3FindResponseType);
604604
}
605-
if (!rootDom.TryGetProperty(tagsName, out JsonElement tagsItem))
605+
if (!rootDom.TryGetProperty(tagsName, out JsonElement tagsItem) && tags.Length != 0)
606606
{
607607
errRecord = new ErrorRecord(
608608
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)