The only requirement for a hash code is that two objects that are considered equal share the same hash code.
You can, for example, use 0 for null properties
public int GetHashCode(MyClass myobj)
{
if(myObj == null)
{
return base.GetHashCode();
}
return (myObj.x != null ? myObj.x.GetGashCode() : 0) ^ (myObj.y != null ? myObj.y.GetGashCode() : 0)
}