Skip to content

Commit 8435d3f

Browse files
committed
[GH Usage] The Model isn't modified when the feature flag is off
1 parent 5a0764e commit 8435d3f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/NuGetGallery/Controllers/PackagesController.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,11 @@ public virtual async Task<ActionResult> DisplayPackage(string id, string version
752752
model.IsCertificatesUIEnabled = _contentObjectService.CertificatesConfiguration?.IsUIEnabledForUser(currentUser) ?? false;
753753
model.IsAtomFeedEnabled = _featureFlagService.IsPackagesAtomFeedEnabled();
754754
model.IsPackageDeprecationEnabled = _featureFlagService.IsManageDeprecationEnabled(currentUser);
755-
model.IsGitHubUsageEnabled = _featureFlagService.IsGitHubUsageEnabled(currentUser);
756755

757-
model.GitHubDependenciesInformation = _contentObjectService.GitHubUsageConfiguration.GetPackageInformation(id);
756+
if(model.IsGitHubUsageEnabled = _featureFlagService.IsGitHubUsageEnabled(currentUser))
757+
{
758+
model.GitHubDependenciesInformation = _contentObjectService.GitHubUsageConfiguration.GetPackageInformation(id);
759+
}
758760

759761
model.ReadMeHtml = await _readMeService.GetReadMeHtmlAsync(package);
760762

0 commit comments

Comments
 (0)