summaryrefslogtreecommitdiff
path: root/src/users.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-02-09 13:25:28 -0500
committerAdam <Adam@anope.org>2011-02-09 13:25:28 -0500
commit36d3fd171085baecce62ac52c2818734ee7bd1f4 (patch)
treec7aca0fdcbd7cb6ec5dd7fccd5cd51e70e9853b1 /src/users.cpp
parentd26a19b41d52c5ac3233165359980d357a3bf121 (diff)
Do not crash if a user is introduced with a nonexistant server
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/users.cpp b/src/users.cpp
index d9a6149cf..9f1cc8404 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -690,10 +690,12 @@ User *do_nick(const Anope::string &source, const Anope::string &nick, const Anop
{
if (source.empty())
{
- /* This is a new user; create a User structure for it. */
- Log(LOG_DEBUG) << "new user: " << nick;
-
Server *serv = Server::Find(server);
+ if (serv == NULL)
+ {
+ Log() << "User " << nick << " introduced with nonexistant server " << server << "!";
+ return NULL;
+ }
/* Allocate User structure and fill it in. */
dynamic_reference<User> user = new User(nick, username, host, uid);