diff --git a/dev/TeachingTip/TeachingTip.cpp b/dev/TeachingTip/TeachingTip.cpp index 1f07226a95..4017e89290 100644 --- a/dev/TeachingTip/TeachingTip.cpp +++ b/dev/TeachingTip/TeachingTip.cpp @@ -1123,17 +1123,22 @@ void TeachingTip::OnPopupOpened(const winrt::IInspectable&, const winrt::IInspec if (auto const teachingTipPeer = winrt::FrameworkElementAutomationPeer::FromElement(*this).try_as()) { - auto const appName = []() + auto const notificationString = [this]() { - if (auto&& package = winrt::ApplicationModel::Package::Current()) + auto const appName = []() { - return package.DisplayName(); - } - return winrt::hstring{}; - }(); + try + { + if (auto&& package = winrt::ApplicationModel::Package::Current()) + { + return package.DisplayName(); + } + } + catch (...) {} + + return winrt::hstring{}; + }(); - auto const notificationString = [this, appName]() - { if (!appName.empty()) { return StringUtil::FormatString(