summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-02-16 16:45:56 -0700
committerIra Rice <irarice@gmail.com>2009-02-16 16:45:56 -0700
commit5964b89cbe0aa78768a6abfe37eafe70f50a3222 (patch)
tree0602f312ac204e9412a5c1fc928b12e6c6d6559d /src/gui
parentd2c175c2d5fba8b78a45d70fbaf24d7b7afe7a3c (diff)
downloadmana-5964b89cbe0aa78768a6abfe37eafe70f50a3222.tar.gz
mana-5964b89cbe0aa78768a6abfe37eafe70f50a3222.tar.bz2
mana-5964b89cbe0aa78768a6abfe37eafe70f50a3222.tar.xz
mana-5964b89cbe0aa78768a6abfe37eafe70f50a3222.zip
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 <irarice@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chat.cpp4
1 files changed, 3 insertions, 1 deletions
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)
{