Skip to content

Commit

Permalink
Catch error in version check
Browse files Browse the repository at this point in the history
  • Loading branch information
segabl committed Jun 27, 2024
1 parent 4750568 commit 1fd8692
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
21 changes: 13 additions & 8 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
8 changes: 7 additions & 1 deletion PD2SoundBankEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
<UseWPF>true</UseWPF>
<StartupObject></StartupObject>
<AssemblyName>PD2SoundBankEditor</AssemblyName>
<Version>1.3.2</Version>
<Version>1.3.3</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<NeutralLanguage>en</NeutralLanguage>
<RollForward>Major</RollForward>
<ApplicationIcon>Icon.ico</ApplicationIcon>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>


Expand All @@ -23,4 +24,9 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>


<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

</Project>

0 comments on commit 1fd8692

Please sign in to comment.