Skip to content

Commit

Permalink
Fix comment, add check for null
Browse files Browse the repository at this point in the history
  • Loading branch information
jgonz120 committed Nov 6, 2024
1 parent c8917d7 commit e7e1397
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ private void ProcessRegistrationPage(
{
catalogEntry.ReportAbuseUrl = _reportAbuseResource?.GetReportAbuseUrl(catalogEntry.PackageId, catalogEntry.Version);
catalogEntry.PackageDetailsUrl = _packageDetailsUriResource?.GetUri(catalogEntry.PackageId, catalogEntry.Version);
catalogEntry.ReadmeFileUrl = _readmeUriTemplateResource?.GetReadmeUrl(catalogEntry.PackageId, catalogEntry.Version);
if (string.IsNullOrWhiteSpace(catalogEntry.ReadmeFileUrl))
{
catalogEntry.ReadmeFileUrl = _readmeUriTemplateResource?.GetReadmeUrl(catalogEntry.PackageId, catalogEntry.Version);
}
catalogEntry = metadataCache.GetObject(catalogEntry);
results.Add(catalogEntry);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public ReadmeUriTemplateResource(string uriTemplate)
}

/// <summary>
/// Gets a URL for reporting package abuse. The URL will not be verified to exist.
/// Get the URL for downloading the readme file.
/// </summary>
/// <param name="id">The package id (natural casing)</param>
/// <param name="id">The package id</param>
/// <param name="version">The package version</param>
/// <returns>The first URL from the resource, with the URI template applied.</returns>
/// <returns>URL to download README, built using the URI template.</returns>
public string GetReadmeUrl(string id, NuGetVersion version)
{
if (_uriTemplate == null)
Expand Down

0 comments on commit e7e1397

Please sign in to comment.