trim a string before tring to convert it to an int, if this still fails report it

This commit is contained in:
TheSnoozer 2019-09-22 10:24:17 +02:00 committed by ORelio
parent 3393e7e402
commit c6b4dc38d0

View file

@ -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>