Skip to content

Commit adea5ef

Browse files
johang88ds5678
andauthored
fix: null checking in IndexBufferBinding equals operator (#3078)
* Fixed null checking in IndexBufferBinding equals operator * Update sources/engine/Stride.Graphics/IndexBufferBinding.cs Co-authored-by: Jeremy Pritts <49847914+ds5678@users.noreply.github.com> --------- Co-authored-by: Jeremy Pritts <49847914+ds5678@users.noreply.github.com>
1 parent e0a2278 commit adea5ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sources/engine/Stride.Graphics/IndexBufferBinding.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ public override bool Equals(object obj)
8787

8888
public static bool operator ==(IndexBufferBinding left, IndexBufferBinding right)
8989
{
90-
return left.Equals(right);
90+
if (ReferenceEquals(left, right))
91+
return true;
92+
93+
return left?.Equals(right) ?? false;
9194
}
9295

9396
public static bool operator !=(IndexBufferBinding left, IndexBufferBinding right)

0 commit comments

Comments
 (0)