Skip to content

Commit ee62bd3

Browse files
[UWP Renderer] Add a null check to requirements in MeetsRequirements (#8235)
* Switch to gotFocus (#8148) (#8150) * Update custom.props * [UWP] Update custom.props for object model release (#8225) * Update custom.props for object model release * Updated Xcode version (#8222) * removed build step as they are redundant (#8201) * removed build step as they are redundant * added pod installation step Co-authored-by: Joseph Woo <Joseph.Woo@microsoft.com> * [UWP Renderer] Add a null check to inline action rendering (#8228) * Update custom.props for object model release * Updated Xcode version (#8222) * removed build step as they are redundant (#8201) * removed build step as they are redundant * added pod installation step * Add a null check for inline Actions Co-authored-by: Joseph Woo <Joseph.Woo@microsoft.com> * Add null check to MeetsRequirements * Remove comment --------- Co-authored-by: Joseph Woo <Joseph.Woo@microsoft.com>
1 parent 7744ce4 commit ee62bd3

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

source/uwp/SharedRenderer/lib/Util.cpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -481,25 +481,27 @@ bool MeetsRequirements(winrt::IAdaptiveCardElement const& cardElement, winrt::Ad
481481
winrt::IVector<winrt::AdaptiveRequirement> requirements = cardElement.Requirements();
482482
bool meetsRequirementsLocal = true;
483483

484-
for (auto req : requirements)
484+
if (requirements)
485485
{
486-
// winrt::hstring name = req.Name();
487-
winrt::hstring registrationVersion = featureRegistration.Get(req.Name());
488-
489-
if (registrationVersion.empty())
490-
{
491-
meetsRequirementsLocal = false;
492-
}
493-
else
486+
for (auto req : requirements)
494487
{
495-
std::string requirementVersionString = HStringToUTF8(req.Version());
496-
if (requirementVersionString != "*")
488+
winrt::hstring registrationVersion = featureRegistration.Get(req.Name());
489+
490+
if (registrationVersion.empty())
491+
{
492+
meetsRequirementsLocal = false;
493+
}
494+
else
497495
{
498-
AdaptiveCards::SemanticVersion requirementSemanticVersion(requirementVersionString);
499-
AdaptiveCards::SemanticVersion registrationSemanticVersion(HStringToUTF8(registrationVersion));
500-
if (registrationSemanticVersion < requirementSemanticVersion)
496+
std::string requirementVersionString = HStringToUTF8(req.Version());
497+
if (requirementVersionString != "*")
501498
{
502-
meetsRequirementsLocal = false;
499+
AdaptiveCards::SemanticVersion requirementSemanticVersion(requirementVersionString);
500+
AdaptiveCards::SemanticVersion registrationSemanticVersion(HStringToUTF8(registrationVersion));
501+
if (registrationSemanticVersion < requirementSemanticVersion)
502+
{
503+
meetsRequirementsLocal = false;
504+
}
503505
}
504506
}
505507
}

0 commit comments

Comments
 (0)