Another fix to prevent hashCode check with null id.