Skip to content

Commit b1405e3

Browse files
committed
Ensure that we actually have the value present
1 parent 27143e9 commit b1405e3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/AppInstallerCLICore/Workflows/PortableFlow.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ namespace AppInstaller::CLI::Workflow
111111
{
112112
Manifest::ScopeEnum scope = Manifest::ScopeEnum::Unknown;
113113
bool isUpdate = WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::InstallerExecutionUseUpdate);
114-
auto installedVersion = context.Get<Execution::Data::InstalledPackageVersion>();
114+
std::shared_ptr<Repository::IPackageVersion> installedVersion;
115+
if (context.Contains(Execution::Data::InstalledPackageVersion))
116+
{
117+
installedVersion = context.Get<Execution::Data::InstalledPackageVersion>();
118+
}
115119
if (isUpdate && installedVersion)
116120
{
117121
IPackageVersion::Metadata installationMetadata = installedVersion->GetMetadata();

0 commit comments

Comments
 (0)