diff options
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index 47553f238..65a027e90 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -55,13 +55,14 @@ ModeHandler::ModeHandler(Module* Creator, const std::string& Name, char modelett CullResult ModeHandler::cull() { - ServerInstance->Modes->DelMode(this); + if (ServerInstance->Modes) + ServerInstance->Modes->DelMode(this); return classbase::cull(); } ModeHandler::~ModeHandler() { - if (ServerInstance && ServerInstance->Modes->FindMode(mode, m_type) == this) + if (ServerInstance && ServerInstance->Modes && ServerInstance->Modes->FindMode(mode, m_type) == this) ServerInstance->Logs->Log("MODE", DEBUG, "ERROR: Destructor for mode %c called while not culled", mode); } @@ -1026,7 +1027,7 @@ ModeParser::ModeParser() ModeParser::~ModeParser() { - ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL); + ModeHandler* mh = FindMode('h', MODETYPE_CHANNEL); if (mh) { mh->cull(); |