File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/AppInstallerCLICore/Workflows Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -111,9 +111,14 @@ namespace AppInstaller::CLI::Workflow
111111 {
112112 Manifest::ScopeEnum scope = Manifest::ScopeEnum::Unknown;
113113 bool isUpdate = WI_IsFlagSet (context.GetFlags (), Execution::ContextFlag::InstallerExecutionUseUpdate);
114- if (isUpdate)
114+ std::shared_ptr<Repository::IPackageVersion> installedVersion;
115+ if (context.Contains (Execution::Data::InstalledPackageVersion))
115116 {
116- IPackageVersion::Metadata installationMetadata = context.Get <Execution::Data::InstalledPackageVersion>()->GetMetadata ();
117+ installedVersion = context.Get <Execution::Data::InstalledPackageVersion>();
118+ }
119+ if (isUpdate && installedVersion)
120+ {
121+ IPackageVersion::Metadata installationMetadata = installedVersion->GetMetadata ();
117122 auto installerScopeItr = installationMetadata.find (Repository::PackageVersionMetadata::InstalledScope);
118123 if (installerScopeItr != installationMetadata.end ())
119124 {
You can’t perform that action at this time.
0 commit comments