mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix crash when bot unloads in GetText()
Reported in #441. Thanks, drcheap!
This commit is contained in:
parent
1cecf2d788
commit
78af234a52
1 changed files with 5 additions and 4 deletions
|
|
@ -454,18 +454,19 @@ namespace MinecraftClient
|
||||||
if (Settings.DisplayChatLinks)
|
if (Settings.DisplayChatLinks)
|
||||||
foreach (string link in links)
|
foreach (string link in links)
|
||||||
ConsoleIO.WriteLineFormatted("§8MCC: Link: " + link, false);
|
ConsoleIO.WriteLineFormatted("§8MCC: Link: " + link, false);
|
||||||
for (int i = 0; i < bots.Count; i++)
|
foreach (ChatBot bot in bots.ToArray())
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bots[i].GetText(text);
|
bot.GetText(text);
|
||||||
bots[i].GetText(text, json);
|
if (bots.Contains(bot))
|
||||||
|
bot.GetText(text, json);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (!(e is ThreadAbortException))
|
if (!(e is ThreadAbortException))
|
||||||
{
|
{
|
||||||
ConsoleIO.WriteLineFormatted("§8GetText: Got error from " + bots[i].ToString() + ": " + e.ToString());
|
ConsoleIO.WriteLineFormatted("§8GetText: Got error from " + bot.ToString() + ": " + e.ToString());
|
||||||
}
|
}
|
||||||
else throw; //ThreadAbortException should not be caught
|
else throw; //ThreadAbortException should not be caught
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue