Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
papafe committed Feb 12, 2024
1 parent 0060595 commit 48da015
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Realm/Realm/DatabaseTypes/KeyPathCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ public static KeyPath For<T>(Expression<Func<T, object>> expression)

private static string GetFullPath(Expression expression)
{
if (expression is MemberExpression memberExpression // Either field or property expression
&& memberExpression.Expression is not null // Filtering out static members
&& memberExpression.Member is PropertyInfo) // Filtering for property expressions only
if (expression is MemberExpression memberExpression //// Either field or property expression
&& memberExpression.Expression is not null //// Filtering out static members
&& memberExpression.Member is PropertyInfo) //// Filtering for property expressions only
{
var subPath = GetFullPath(memberExpression.Expression);
return string.IsNullOrEmpty(subPath) ? memberExpression.Member.Name : $"{subPath}.{memberExpression.Member.Name}";
Expand Down

0 comments on commit 48da015

Please sign in to comment.