Skip to content

Commit

Permalink
correctly check type when path is null or "."
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Jan 24, 2024
1 parent 943c7da commit 48ff75b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Maui.DataGrid/Extensions/ReflectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,16 @@ internal static class ReflectionExtensions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Type? GetPropertyTypeByPath(this Type type, string path)
{
if (type == null || string.IsNullOrWhiteSpace(path))
if (type == null)
{
return null;
}

if (path == "." || string.IsNullOrWhiteSpace(path))
{
return type;
}

Type? resultType;

if (path.Contains(PropertyOfOp, StringComparison.Ordinal))
Expand Down

0 comments on commit 48ff75b

Please sign in to comment.