From add32607b88e2e53cc5e35172bcf4be7e4c9d409 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 11 May 2006 21:52:16 +0000 Subject: Fix bug with knock on non-existent channel git-svn-id: http://svn.inspircd.org/repository/branches/1_0_stable@3956 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_knock.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/modules/m_knock.cpp') diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 9169cfd4c..c056954cf 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')) -- cgit v1.3.1-10-gc9f91