From b566882e84c26fb38bc1db744dab993c65ae3fc7 Mon Sep 17 00:00:00 2001 From: ORelio Date: Tue, 3 Feb 2015 12:39:02 +0100 Subject: [PATCH] Quick GUI fix Crash report by unamedgamer1 --- MinecraftClientGUI/MinecraftClient.cs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/MinecraftClientGUI/MinecraftClient.cs b/MinecraftClientGUI/MinecraftClient.cs index 987be7cd..abf9b4ef 100644 --- a/MinecraftClientGUI/MinecraftClient.cs +++ b/MinecraftClientGUI/MinecraftClient.cs @@ -86,21 +86,24 @@ namespace MinecraftClientGUI while (line.Trim() == "") { line = Client.StandardOutput.ReadLine() + Client.MainWindowTitle; - if (line == "Server was successfuly joined.") { disconnected = false; } - if (line == "You have left the server.") { disconnected = true; } - if (line[0] == (char)0x00) + if (line.Length > 0) { - //App message from the console - string[] command = line.Substring(1).Split((char)0x00); - switch (command[0].ToLower()) + if (line == "Server was successfuly joined.") { disconnected = false; } + if (line == "You have left the server.") { disconnected = true; } + if (line[0] == (char)0x00) { - case "autocomplete": - if (command.Length > 1) { tabAutoCompleteBuffer.AddLast(command[1]); } - else tabAutoCompleteBuffer.AddLast(""); - break; + //App message from the console + string[] command = line.Substring(1).Split((char)0x00); + switch (command[0].ToLower()) + { + 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; }