Update check fix.

This commit is contained in:
J.D. Purcell 2019-11-02 17:00:53 -04:00
parent afff86fb29
commit 64e8270cab
1 changed files with 6 additions and 1 deletions

View File

@ -78,7 +78,7 @@ namespace BizHawk.Client.EmuHawk
{
JObject response = JObject.Parse(DownloadURLAsString(_latestVersionInfoURL));
LatestVersion = (string)response["name"];
LatestVersion = ValidateVersionNumberString((string)response["name"]);
}
catch
{
@ -100,6 +100,11 @@ namespace BizHawk.Client.EmuHawk
return responseStream.ReadToEnd();
}
private static string ValidateVersionNumberString(string versionNumber)
{
return versionNumber != null && ParseVersion(versionNumber) != 0 ? versionNumber : "";
}
// Major version goes in the first 16 bits, and so on, up to 4 parts
private static ulong ParseVersion(string str)
{