Skip to content

Commit 3ca0e49

Browse files
LalithaNadimpallimichael-hawker
authored andcommitted
AttachedDropShadowCrashFix
Adding a null reference check to AttachedDropShadow crash issue
1 parent fdaef47 commit 3ca0e49

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Microsoft.Toolkit.Uwp.UI/Shadows/AttachedShadowBase.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,12 @@ public AttachedShadowElementContext GetElementContext(FrameworkElement element)
174174
/// <inheritdoc/>
175175
public IEnumerable<AttachedShadowElementContext> EnumerateElementContexts()
176176
{
177-
foreach (var kvp in ShadowElementContextTable)
177+
if (ShadowElementContextTable != null)
178178
{
179-
yield return kvp.Value;
179+
foreach (var kvp in ShadowElementContextTable)
180+
{
181+
yield return kvp.Value;
182+
}
180183
}
181184
}
182185

0 commit comments

Comments
 (0)