Skip to content

Fix two minor bugs w/reading V3 server responses #991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/code/V3ServerAPICalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,10 @@ private Hashtable FindResourceType(string[] resourceTypeName, out ExceptionDispa
{
Hashtable resourceHash = new Hashtable();
JsonElement[] resources = GetJsonElementArr($"{repository.Uri}", resourcesName, out edi);
if (edi != null)
{
return resourceHash;
}

foreach (JsonElement resource in resources)
{
Expand Down Expand Up @@ -654,7 +658,7 @@ private string FindVersionHelper(string registrationsBaseUrl, string packageName
JsonDocument pkgMappingDom = JsonDocument.Parse(pkgMappingResponse);
JsonElement rootPkgMappingDom = pkgMappingDom.RootElement;

if (!rootPkgMappingDom.TryGetProperty("catalogEntry", out JsonElement catalogEntryUrlElement) || String.IsNullOrEmpty(catalogEntryUrl))
if (!rootPkgMappingDom.TryGetProperty("catalogEntry", out JsonElement catalogEntryUrlElement))
{
string errMsg = $"FindVersionHelper(): CatalogEntry element could not be found in response or was empty.";
edi = ExceptionDispatchInfo.Capture(new JsonParsingException(errMsg));
Expand Down