summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'))