Unity: Fix crash when comparing open-ended latest version

This commit is contained in:
Katy Coe
2020-12-20 23:24:59 +01:00
parent 9af53561cf
commit 8ae727852f

View File

@@ -205,7 +205,9 @@ namespace Il2CppInspector.Cpp.UnityHeaders
public override bool Equals(object obj) => Equals(obj as UnityVersionRange);
public bool Equals(UnityVersionRange other) => Min.Equals(other?.Min) && Max.Equals(other?.Max);
public bool Equals(UnityVersionRange other) => Min.Equals(other?.Min)
&& ((Max != null && Max.Equals(other?.Max))
|| (Max == null && other != null && other.Max == null));
public override int GetHashCode() => HashCode.Combine(Min, Max);
}