From 5b2329bf1d052d0f97d1065dbc6c29902fc15d75 Mon Sep 17 00:00:00 2001 From: ZacAttack Date: Mon, 23 Sep 2024 07:13:02 -0700 Subject: [PATCH] added fallback for hash in case git folder is missing or other issue. --- App.xaml.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/App.xaml.cs b/App.xaml.cs index 9da7cd4..df57ed0 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -15,7 +15,9 @@ namespace WinDurango.UI public static readonly uint Major = (uint)Fvi.ProductMajorPart; public static readonly uint Minor = (uint)Fvi.ProductMinorPart; public static readonly uint Patch = (uint)Fvi.ProductBuildPart; - public static readonly string Hash = Fvi.ProductVersion.Split("+")[1][..7]; + public static readonly string Hash = Fvi.ProductVersion.Contains("+") + ? Fvi.ProductVersion.Split("+")[1][..7] + : "HASHFAIL"; public static readonly uint VerPacked = (Major << 22) | (Minor << 12) | Patch; public static readonly string Version = $"{Fvi.ProductMajorPart}.{Fvi.ProductMinorPart}.{Fvi.ProductBuildPart}_{Hash}"; // 1.0 will be when bugs are squashed and everything works correctly. public static readonly MainWindow MainWindow = new();