mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Harden CLI setting value conversion error handling
Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/d53ef12a-695a-4687-bb53-f467c7121aea
This commit is contained in:
parent
87593b17b9
commit
f405548529
1 changed files with 11 additions and 1 deletions
|
|
@ -501,7 +501,17 @@ namespace MinecraftClient
|
|||
converted = Convert.ChangeType(input, effectiveType, CultureInfo.InvariantCulture);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
catch (InvalidCastException)
|
||||
{
|
||||
converted = null;
|
||||
return false;
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
converted = null;
|
||||
return false;
|
||||
}
|
||||
catch (OverflowException)
|
||||
{
|
||||
converted = null;
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue