Skip to content

Commit 5cd07d5

Browse files
committed
fix: added backward compatability relationship attr equality check
1 parent ad85758 commit 5cd07d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/JsonApiDotNetCore/Models/RelationshipAttribute.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ public override bool Equals(object obj)
100100
return false;
101101
}
102102
bool equalRelationshipName = PublicRelationshipName.Equals(attr.PublicRelationshipName);
103-
bool equalPrincipalType = PrincipalType.Equals(attr.PrincipalType);
103+
104+
bool equalPrincipalType = true;
105+
if (PrincipalType != null)
106+
{
107+
equalPrincipalType = PrincipalType.Equals(attr.PrincipalType);
108+
}
104109
return IsHasMany == attr.IsHasMany && equalRelationshipName && equalPrincipalType;
105110
}
106111

0 commit comments

Comments
 (0)