mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
trim a string before tring to convert it to an int, if this still fails report it
This commit is contained in:
parent
3393e7e402
commit
c6b4dc38d0
1 changed files with 5 additions and 2 deletions
|
|
@ -641,9 +641,12 @@ namespace MinecraftClient
|
|||
{
|
||||
try
|
||||
{
|
||||
return Convert.ToInt32(str);
|
||||
return Convert.ToInt32(str.Trim());
|
||||
}
|
||||
catch {
|
||||
ConsoleIO.WriteLogLine("Failed to convert '" + str + "' into an int. Please check your settings.");
|
||||
return 0;
|
||||
}
|
||||
catch { return 0; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue