Quick GUI fix

Crash report by unamedgamer1
This commit is contained in:
ORelio 2015-02-03 12:39:02 +01:00
parent 2408b51d28
commit b566882e84

View file

@ -86,21 +86,24 @@ namespace MinecraftClientGUI
while (line.Trim() == "") while (line.Trim() == "")
{ {
line = Client.StandardOutput.ReadLine() + Client.MainWindowTitle; line = Client.StandardOutput.ReadLine() + Client.MainWindowTitle;
if (line == "Server was successfuly joined.") { disconnected = false; } if (line.Length > 0)
if (line == "You have left the server.") { disconnected = true; }
if (line[0] == (char)0x00)
{ {
//App message from the console if (line == "Server was successfuly joined.") { disconnected = false; }
string[] command = line.Substring(1).Split((char)0x00); if (line == "You have left the server.") { disconnected = true; }
switch (command[0].ToLower()) if (line[0] == (char)0x00)
{ {
case "autocomplete": //App message from the console
if (command.Length > 1) { tabAutoCompleteBuffer.AddLast(command[1]); } string[] command = line.Substring(1).Split((char)0x00);
else tabAutoCompleteBuffer.AddLast(""); switch (command[0].ToLower())
break; {
case "autocomplete":
if (command.Length > 1) { tabAutoCompleteBuffer.AddLast(command[1]); }
else tabAutoCompleteBuffer.AddLast("");
break;
}
} }
else OutputBuffer.AddLast(line);
} }
else OutputBuffer.AddLast(line);
} }
} }
catch (NullReferenceException) { break; } catch (NullReferenceException) { break; }