From da581788efc4f0c3104560c14c5632444174499c Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 11 May 2006 21:52:29 +0000 Subject: Fix bug when knocking on non-existent channel git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3957 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_knock.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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')) -- cgit v1.2.3