mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix crash when resizing terminal
Bug report by doranchak
This commit is contained in:
parent
ea17ec87f1
commit
2cf46c0487
1 changed files with 27 additions and 17 deletions
|
|
@ -192,6 +192,8 @@ namespace MinecraftClient
|
||||||
while (reading_lock) { }
|
while (reading_lock) { }
|
||||||
writing_lock = true;
|
writing_lock = true;
|
||||||
if (reading)
|
if (reading)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
string buf = buffer;
|
string buf = buffer;
|
||||||
string buf2 = buffer2;
|
string buf2 = buffer2;
|
||||||
|
|
@ -215,6 +217,14 @@ namespace MinecraftClient
|
||||||
for (int i = 0; i < buffer2.Length; i++) { GoBack(); }
|
for (int i = 0; i < buffer2.Length; i++) { GoBack(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (ArgumentOutOfRangeException)
|
||||||
|
{
|
||||||
|
//Console resized: Try again
|
||||||
|
Console.Write('\n');
|
||||||
|
writing_lock = false;
|
||||||
|
Write(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
else Console.Write(text);
|
else Console.Write(text);
|
||||||
writing_lock = false;
|
writing_lock = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue