Skip to content

Commit 15b9c8f

Browse files
committed
Fix code added after refactor PR created
1 parent b85c768 commit 15b9c8f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/AppInstallerCLICore/Workflows/RepairFlow.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "AppInstallerSynchronization.h"
1515
#include "MSStoreInstallerHandler.h"
1616
#include "ManifestComparator.h"
17+
#include <winget/PackageVersionSelection.h>
1718

1819
using namespace AppInstaller::Manifest;
1920
using namespace AppInstaller::Msix;
@@ -443,10 +444,11 @@ namespace AppInstaller::CLI::Workflow
443444
std::string_view requestedVersion = context.Args.Contains(Execution::Args::Type::Version) ? context.Args.GetArg(Execution::Args::Type::Version) : installedVersion.ToString();
444445
// If it's Store source with only one version unknown, use the unknown version for available version mapping.
445446
const auto& package = context.Get<Execution::Data::Package>();
446-
auto versionKeys = package->GetAvailableVersionKeys();
447+
auto packageVersions = GetAvailableVersionsForInstalledVersion(package, installedPackage);
448+
auto versionKeys = packageVersions->GetVersionKeys();
447449
if (versionKeys.size() == 1)
448450
{
449-
auto packageVersion = package->GetAvailableVersion(versionKeys.at(0));
451+
auto packageVersion = packageVersions->GetVersion(versionKeys.at(0));
450452
if (packageVersion->GetSource().IsWellKnownSource(WellKnownSource::MicrosoftStore) &&
451453
Utility::Version{ packageVersion->GetProperty(PackageVersionProperty::Version) }.IsUnknown())
452454
{

0 commit comments

Comments
 (0)