diff --git a/source/uwp/AdaptiveCardsObjectModel/lib/ObjectModelUtil.cpp b/source/uwp/AdaptiveCardsObjectModel/lib/ObjectModelUtil.cpp index 62f58b15b7..55215e9b72 100644 --- a/source/uwp/AdaptiveCardsObjectModel/lib/ObjectModelUtil.cpp +++ b/source/uwp/AdaptiveCardsObjectModel/lib/ObjectModelUtil.cpp @@ -307,13 +307,17 @@ winrt::AdaptiveCards::ObjectModel::Uwp::IAdaptiveCardElement GenerateElementProj case CardElementType::Table: return winrt::make( std::AdaptivePointerCast(baseElement)); - break; case CardElementType::Custom: return std::AdaptivePointerCast<::AdaptiveCards::ObjectModel::Uwp::CustomElementWrapper>(baseElement)->GetWrappedElement(); case CardElementType::Unknown: - default: return winrt::make( std::AdaptivePointerCast(baseElement)); + default: + // It should not be possible for an element represented by a CardElementType to not have a matching case here. + // Either a new element has been introduced in the shared model without full support here in UWP, or there's a + // bug in the shared model (see https://github.com/microsoft/AdaptiveCards/issues/6393). + + throw winrt::hresult_error(E_UNEXPECTED, L"CardElementType not supported"); } }