From 1fd869257ef57832a8504c61b8d6cd1fd76cadfe Mon Sep 17 00:00:00 2001 From: Sebastian Gabl Date: Thu, 27 Jun 2024 16:12:03 +0200 Subject: [PATCH] Catch error in version check --- MainWindow.xaml.cs | 21 +++++++++++++-------- PD2SoundBankEditor.csproj | 8 +++++++- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index e78de00..e286633 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -552,16 +552,21 @@ private void SetPlayButtonState(object sender, EventArgs e) { } } private int CompareVersionStrings(string v1, string v2) { - var nums1 = v1.Split(".").Select(int.Parse).ToArray(); - var nums2 = v2.Split(".").Select(int.Parse).ToArray(); - for (var i = 0; i < nums1.Length && i < nums2.Length; i++) { - if (nums1[i] == nums2[i]) { - continue; - } else { - return Math.Sign(nums1[i] - nums2[i]); + try { + var nums1 = v1.Split(".").Select(int.Parse).ToArray(); + var nums2 = v2.Split(".").Select(int.Parse).ToArray(); + for (var i = 0; i < nums1.Length && i < nums2.Length; i++) { + if (nums1[i] == nums2[i]) { + continue; + } else { + return Math.Sign(nums1[i] - nums2[i]); + } } + return Math.Sign(nums1.Length - nums2.Length); + } catch (Exception ex) { + File.AppendAllText(LOG_PATH, ex.Message); + return 0; } - return Math.Sign(nums1.Length - nums2.Length); } } } diff --git a/PD2SoundBankEditor.csproj b/PD2SoundBankEditor.csproj index bd71b33..1f8e1f1 100644 --- a/PD2SoundBankEditor.csproj +++ b/PD2SoundBankEditor.csproj @@ -6,12 +6,13 @@ true PD2SoundBankEditor - 1.3.2 + 1.3.3 1.0.0.0 1.0.0.0 en Major Icon.ico + false @@ -23,4 +24,9 @@ + + + + +