From 28b4480f30bcf9ae3c575928010c28be295ba319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=9A=D0=BE=D0=BB=D0=BE=D1=81=D0=BE=D0=B2?= Date: Tue, 10 Dec 2024 18:54:29 +0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20bug=20with=20unstable=20ve?= =?UTF-8?q?rsion.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TUI/Domain/Version.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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(), "");