diff --git a/src/TUI/Domain/Version.cs b/src/TUI/Domain/Version.cs index 1ebb405..8ac98d3 100644 --- a/src/TUI/Domain/Version.cs +++ b/src/TUI/Domain/Version.cs @@ -14,8 +14,25 @@ public class Version { var parts = version.Split('.'); + if (parts.Length == 0) + { + return; + } + Major = Convert.ToInt32(parts[0].RemoveVersionPrefix()); + + if (parts.Length == 1) + { + return; + } + Minor = Convert.ToInt32(parts[1]); + + if (parts.Length == 2) + { + return; + } + Patch = Convert.ToInt32(string.Join("", parts[2].TakeWhile(char.IsDigit))); var extension = parts[2].Replace(Patch.ToString(), "");