summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-05-11 21:52:29 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-05-11 21:52:29 +0000
commitda581788efc4f0c3104560c14c5632444174499c (patch)
tree792420bfb1c0d2c409ee9f450c345b5247e89b10 /src
parent1ee80d5d5f90580efb0151f40d38dc4dff2fec92 (diff)
Fix bug when knocking on non-existent channel
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3957 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_knock.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp
index c22fe5ff0..0629f1023 100644
--- a/src/modules/m_knock.cpp
+++ b/src/modules/m_knock.cpp
@@ -38,6 +38,13 @@ class cmd_knock : public command_t
void Handle (char **parameters, int pcnt, userrec *user)
{
chanrec* c = Srv->FindChannel(parameters[0]);
+
+ if (!c)
+ {
+ WriteServ(user->fd,"401 %s %s :No such channel",user->nick, parameters[0]);
+ return;
+ }
+
std::string line = "";
if (c->IsModeSet('K'))