summaryrefslogtreecommitdiff
path: root/src/commandhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commandhandler.cpp')
-rw-r--r--src/commandhandler.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index 58b8905d..66f746f3 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -96,8 +96,21 @@ void CommandHandler::handleCommand(const std::string &command)
else if (type == "post")
{
std::string::size_type pos = args.find(' ');
+ if (pos == std::string::npos)
+ {
+ chatWindow->chatLog("Please include the user and message");
+ return;
+ }
std::string recipient(args, 0, pos);
+ if (recipient == "")
+ {
+ chatWindow->chatLog("Invalid user");
+ }
std::string text(args, pos+1);
+ if (text == "")
+ {
+ chatWindow->chatLog("Invalid message");
+ }
Net::GameServer::Player::sendLetter(recipient, text);
}
else if (type == "check")