Skip to content

Commit

Permalink
Add null check to discern on element being an action (microsoft#3119)
Browse files Browse the repository at this point in the history
  • Loading branch information
almedina-ms committed Jul 2, 2019
1 parent 3c56ac3 commit e5f597d
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,13 @@ private TagContent GetTagContent(FrameworkElement element)
/// <param name="tagContent">Rendered element tag</param>
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;
Expand Down

0 comments on commit e5f597d

Please sign in to comment.