From a1754ed5a5e58d1ad85c72e8f21d2376240b7f76 Mon Sep 17 00:00:00 2001 From: Sewer 56 Date: Tue, 18 Jan 2022 00:09:50 +0000 Subject: [PATCH] Changed: Ignore version.txt parse errors. --- source/Reloaded.Mod.Launcher.Lib/Utility/Version.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/Reloaded.Mod.Launcher.Lib/Utility/Version.cs b/source/Reloaded.Mod.Launcher.Lib/Utility/Version.cs index ef0f24bb..3b478468 100644 --- a/source/Reloaded.Mod.Launcher.Lib/Utility/Version.cs +++ b/source/Reloaded.Mod.Launcher.Lib/Utility/Version.cs @@ -34,8 +34,12 @@ public static class Version if (_version != null) return _version; - if (File.Exists(Constants.VersionFilePath)) - return SetAndReturnVersion(NuGetVersion.Parse(File.ReadAllText(Constants.VersionFilePath))); + try + { + if (File.Exists(Constants.VersionFilePath)) + return SetAndReturnVersion(NuGetVersion.Parse(File.ReadAllText(Constants.VersionFilePath))); + } + catch { /* Ignore */ } return SetAndReturnVersion(new NuGetVersion(Assembly.GetEntryAssembly()!.GetName().Version)); }