summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-12-05 16:15:00 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-12-05 16:15:00 +0000
commit5e695dfaa659614d76e4215619625aa74134400f (patch)
treeaa2a0c9ff7ed522452f0cbb2256aabd1d8a0c7ef /src
parentfd9af90faa9348f42666ebb04ccea2d5911e7d54 (diff)
downloadmana-5e695dfaa659614d76e4215619625aa74134400f.tar.gz
mana-5e695dfaa659614d76e4215619625aa74134400f.tar.bz2
mana-5e695dfaa659614d76e4215619625aa74134400f.tar.xz
mana-5e695dfaa659614d76e4215619625aa74134400f.zip
Avoid crashing on trying to log the name of a non-existing character.
Diffstat (limited to 'src')
-rw-r--r--src/gui/char_server.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 7a9090cd..202c3e29 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -224,8 +224,12 @@ void ServerSelectDialog::selectServer(int index)
state = CHAR_SELECT_STATE;
- logger->log("CharServer: Player: %s (Packet ID: %x, Length: %d)",
- char_info[0]->name.c_str(), msg.getId(), msg.getLength());
+ if (n_character > 0)
+ {
+ logger->log("CharServer: Player: %s (Packet ID: %x, Length: %d)",
+ char_info[0]->name.c_str(), msg.getId(),
+ msg.getLength());
+ }
skip(msg.getLength());
}