summaryrefslogtreecommitdiff
path: root/modules/core/ns_set_autoop.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/ns_set_autoop.cpp')
-rw-r--r--modules/core/ns_set_autoop.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/core/ns_set_autoop.cpp b/modules/core/ns_set_autoop.cpp
index f25e3a749..051ce22e6 100644
--- a/modules/core/ns_set_autoop.cpp
+++ b/modules/core/ns_set_autoop.cpp
@@ -12,6 +12,7 @@
/*************************************************************************/
#include "module.h"
+#include "nickserv.h"
class CommandNSSetAutoOp : public Command
{
@@ -95,22 +96,25 @@ class NSSetAutoOp : public Module
this->SetAuthor("Anope");
this->SetType(CORE);
- Command *c = FindCommand(NickServ, "SET");
+ if (!nickserv)
+ throw ModuleException("NickServ is not loaded!");
+
+ Command *c = FindCommand(nickserv->Bot(), "SET");
if (c)
c->AddSubcommand(this, &commandnssetautoop);
- c = FindCommand(NickServ, "SASET");
+ c = FindCommand(nickserv->Bot(), "SASET");
if (c)
c->AddSubcommand(this, &commandnssasetautoop);
}
~NSSetAutoOp()
{
- Command *c = FindCommand(NickServ, "SET");
+ Command *c = FindCommand(nickserv->Bot(), "SET");
if (c)
c->DelSubcommand(&commandnssetautoop);
- c = FindCommand(NickServ, "SASET");
+ c = FindCommand(nickserv->Bot(), "SASET");
if (c)
c->DelSubcommand(&commandnssasetautoop);
}