diff --git a/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveRenderContext.cs b/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveRenderContext.cs index ba34adc95e..e345ae842c 100644 --- a/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveRenderContext.cs +++ b/source/dotnet/Library/AdaptiveCards.Rendering.Wpf/AdaptiveRenderContext.cs @@ -314,6 +314,13 @@ private TagContent GetTagContent(FrameworkElement element) /// Rendered element tag public void SetVisibility(FrameworkElement element, bool desiredVisibility, TagContent tagContent) { + // TagContents are only assigned to card elements so actions mustn't have a TagContent object tied to it + // TagContents are used to save information on the rendered object as the element separator + if (tagContent == null) + { + return; + } + bool elementIsCurrentlyVisible = (element.Visibility == Visibility.Visible); element.Visibility = desiredVisibility ? Visibility.Visible : Visibility.Collapsed;