diff --git a/src/AppInstallerCLICore/Workflows/DownloadFlow.cpp b/src/AppInstallerCLICore/Workflows/DownloadFlow.cpp index b933e50730..119e2d1b1d 100644 --- a/src/AppInstallerCLICore/Workflows/DownloadFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/DownloadFlow.cpp @@ -428,6 +428,13 @@ namespace AppInstaller::CLI::Workflow std::placeholders::_1, downloadInfo)); + // User cancelled. + if (downloadResult.Sha256Hash.empty()) + { + context.Reporter.Info() << Resource::String::Cancelled << std::endl; + AICLI_TERMINATE_CONTEXT(E_ABORT); + } + if (downloadResult.SizeInBytes == 0) { AICLI_LOG(CLI, Info, << "Got zero byte file; retrying download after a short wait..."); @@ -482,12 +489,6 @@ namespace AppInstaller::CLI::Workflow } } - if (downloadResult.Sha256Hash.empty()) - { - context.Reporter.Info() << Resource::String::Cancelled << std::endl; - AICLI_TERMINATE_CONTEXT(E_ABORT); - } - context.Add(std::make_pair(installer.Sha256, downloadResult)); }