ArgumentNullException.ThrowIfNull in Helper

This commit is contained in:
Jeremy Sinclair 2023-08-23 20:00:01 -04:00
parent e504ddbe2f
commit 5d1c3e6d2d

View File

@ -114,11 +114,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library.Utilities
{
// Split up the version strings into int[]
// Example: v10.0.2 -> {10, 0, 2};
if (version1 == null)
{
throw new ArgumentNullException(nameof(version1));
}
else ArgumentNullException.ThrowIfNull(version2);
ArgumentNullException.ThrowIfNull(version1);
ArgumentNullException.ThrowIfNull(version2);
var v1 = version1.Substring(1).Split('.').Select(int.Parse).ToArray();
var v2 = version2.Substring(1).Split('.').Select(int.Parse).ToArray();