Skip to content

Commit 6400fdf

Browse files
authored
Fix runtime error (#9902)
1 parent 139eb49 commit 6400fdf

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/NuGetGallery/Services/TyposquattingCheckListCacheService.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,14 @@ public IReadOnlyCollection<string> GetTyposquattingCheckList(int checkListConfig
4646
if (ShouldCacheBeUpdated(checkListConfiguredLength, checkListExpireTime))
4747
{
4848
TyposquattingCheckListConfiguredLength = checkListConfiguredLength;
49-
IQueryable<string> cacheQuery = packageService.GetAllPackageRegistrations()
49+
List<string> cachedPackages = packageService.GetAllPackageRegistrations()
5050
.OrderByDescending(pr => pr.IsVerified)
5151
.ThenByDescending(pr => pr.DownloadCount)
5252
.Select(pr => pr.Id)
53-
.Take(TyposquattingCheckListConfiguredLength);
53+
.Take(TyposquattingCheckListConfiguredLength)
54+
.ToList();
5455

55-
Cache = cacheQuery
56+
Cache = cachedPackages
5657
.Select(pr => _typosquattingServiceHelper.NormalizeString(pr))
5758
.ToList();
5859

0 commit comments

Comments
 (0)