From 5964b89cbe0aa78768a6abfe37eafe70f50a3222 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 16 Feb 2009 16:45:56 -0700 Subject: Fixed a nasty crash that was only visible from the @help command. If the line's string was empty after trimming, the client would crash when trying to get a substring. Signed-off-by: Ira Rice --- src/gui/chat.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index b6fb7577..22126af3 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -117,12 +117,14 @@ void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord) // Trim whitespace trim(line); + if (line.empty()) + return; + CHATLOG tmp; tmp.own = own; tmp.nick = ""; tmp.text = line; - std::string::size_type pos = line.find(" : "); if (pos != std::string::npos) { -- cgit v1.2.3-70-g09d2