Skip to content

Commit 2d8bdbf

Browse files
committed
fix: Equals(ColumnMapping) broken for null references
1 parent 1f12d0f commit 2d8bdbf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/FluentNHibernate/MappingModel/ColumnMapping.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,14 @@ public ColumnMapping Clone()
9494

9595
public bool Equals(ColumnMapping other)
9696
{
97-
return Equals(other.attributes, attributes) && Equals(other.Member, Member);
97+
return (other != null) &&
98+
Equals(other.attributes, attributes) &&
99+
Equals(other.Member, Member);
98100
}
99101

100102
public override bool Equals(object obj)
101103
{
102-
if (obj.GetType() != typeof(ColumnMapping)) return false;
103-
return Equals((ColumnMapping)obj);
104+
return Equals(obj as ColumnMapping);
104105
}
105106

106107
public override int GetHashCode()

0 commit comments

Comments
 (0)