🐛 Fix bug with unstable version.

This commit is contained in:
Kolosov Alexandr 2024-12-10 18:54:29 +05:00
parent 5eda85d006
commit 28b4480f30

View File

@ -14,8 +14,25 @@ public class Version
{ {
var parts = version.Split('.'); var parts = version.Split('.');
if (parts.Length == 0)
{
return;
}
Major = Convert.ToInt32(parts[0].RemoveVersionPrefix()); Major = Convert.ToInt32(parts[0].RemoveVersionPrefix());
if (parts.Length == 1)
{
return;
}
Minor = Convert.ToInt32(parts[1]); Minor = Convert.ToInt32(parts[1]);
if (parts.Length == 2)
{
return;
}
Patch = Convert.ToInt32(string.Join("", parts[2].TakeWhile(char.IsDigit))); Patch = Convert.ToInt32(string.Join("", parts[2].TakeWhile(char.IsDigit)));
var extension = parts[2].Replace(Patch.ToString(), ""); var extension = parts[2].Replace(Patch.ToString(), "");