Object.Equals(object) overrides should not throw
Especially not if you pass null. null is simply not equal to this, that's all. The post condition is satisfiable; you can return false.
This commit is contained in:
parent
51b62629c6
commit
f284fda3a6
|
@ -83,7 +83,7 @@ namespace BizHawk.Common
|
|||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return this == (Bit) (obj ?? throw new NullReferenceException()); // this is probably wrong
|
||||
return obj is Bit b && this == b;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue