Skip to content

Commit 64c56d7

Browse files
committed
Fixed an ArgumentNullException in TryGetContentControl
1 parent 9e56083 commit 64c56d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Microsoft.Toolkit.Uwp.UI/Extensions/Tree/LogicalTree.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ public static IEnumerable<FrameworkElement> FindParents(this FrameworkElement el
567567
public static UIElement? TryGetContentControl(this FrameworkElement element)
568568
{
569569
Type type = element.GetType();
570-
TypeInfo typeInfo = type.GetTypeInfo();
570+
TypeInfo? typeInfo = type.GetTypeInfo();
571571

572572
while (typeInfo is not null)
573573
{
@@ -584,7 +584,7 @@ public static IEnumerable<FrameworkElement> FindParents(this FrameworkElement el
584584
}
585585
}
586586

587-
typeInfo = typeInfo.BaseType.GetTypeInfo();
587+
typeInfo = typeInfo.BaseType?.GetTypeInfo();
588588
}
589589

590590
return null;

0 commit comments

Comments
 (0)