X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_disable.cpp;h=95fcd8b4cb1fe49c90f8905b9fc68dbe2409efef;hb=3151d60c1ecc9462e4c335282ee6c31672f45111;hp=9791ec7ebd8ee981f5f6385c23e1323ee6d2ab9e;hpb=4a6fedd9324d87349a806c9c1d0ae6e7d3c1fd38;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_disable.cpp b/src/modules/m_disable.cpp index 9791ec7eb..95fcd8b4c 100644 --- a/src/modules/m_disable.cpp +++ b/src/modules/m_disable.cpp @@ -1,7 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2019 Sadie Powell + * Copyright (C) 2019-2020 Sadie Powell * Copyright (C) 2019 Robby * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -55,7 +55,7 @@ class ModuleDisable : public Module // Check that the mode actually exists. ModeHandler* mh = ServerInstance->Modes->FindMode(chr, type); - if (!chr) + if (!mh) throw ModuleException(InspIRCd::Format("Nonexistent mode '%c' was specified in at %s", chr, field.c_str(), tag->getTagLocation().c_str())); @@ -93,8 +93,8 @@ class ModuleDisable : public Module throw ModuleException(InspIRCd::Format("Nonexistent command '%s' was specified in at %s", command.c_str(), tag->getTagLocation().c_str())); - // Prevent admins from disabling COMMANDS and MODULES for transparency reasons. - if (handler->name == "COMMANDS" || handler->name == "MODULES") + // Prevent admins from disabling MODULES for transparency reasons. + if (handler->name == "MODULES") continue; // Disable the command.