Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 206a94e

Browse files
authored
Update VisualElementExtension.shared.cs (#961)
1 parent 0a7f032 commit 206a94e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/CommunityToolkit/Xamarin.CommunityToolkit/Extensions/VisualElementExtension.shared.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ internal static bool TryFindParentElementWithParentOfType<T>(this VisualElement
4141

4242
result = null;
4343
parent = null;
44-
while (element.Parent != null)
44+
while (element?.Parent != null)
4545
{
4646
if (!(element.Parent is T parentElement))
4747
{

0 commit comments

Comments
 (0)