Skip to content

Commit

Permalink
AttachedDropShadowCrashFix
Browse files Browse the repository at this point in the history
Adding a null reference check to AttachedDropShadow crash issue
  • Loading branch information
LalithaNadimpalli committed Sep 7, 2022
1 parent db12288 commit d34d637
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Microsoft.Toolkit.Uwp.UI/Shadows/AttachedShadowBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,12 @@ public AttachedShadowElementContext GetElementContext(FrameworkElement element)
/// <inheritdoc/>
public IEnumerable<AttachedShadowElementContext> EnumerateElementContexts()
{
foreach (var kvp in ShadowElementContextTable)
if (ShadowElementContextTable != null)
{
yield return kvp.Value;
foreach (var kvp in ShadowElementContextTable)
{
yield return kvp.Value;
}
}
}

Expand Down

0 comments on commit d34d637

Please sign in to comment.