Fix #5054: do not wrap the parse exception.

This commit is contained in:
Ben 2025-02-10 18:33:48 +08:00
parent bdf4e4442b
commit 311c601f1a

View File

@ -21,12 +21,7 @@ namespace Oqtane.Shared
public static int ParseInteger(string value, CultureInfo cultureInfo, int defaultValue) public static int ParseInteger(string value, CultureInfo cultureInfo, int defaultValue)
{ {
if (int.TryParse(value, cultureInfo, out int result)) return int.Parse(value, cultureInfo);
{
return result;
}
return defaultValue;
} }
} }
} }