ServerInstance->Users->all_opers.push_back(u);
ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER);
- u->SetMode(opermh, true);
+ if (opermh)
+ u->SetMode(opermh, true);
ServerConfig::OperIndex::const_iterator iter = ServerInstance->Config->OperTypes.find(opertype);
if (iter != ServerInstance->Config->OperTypes.end())
void User::Oper(OperInfo* info)
{
ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER);
- if (this->IsModeSet(opermh))
- this->UnOper();
-
- this->SetMode(opermh, true);
+ if (opermh)
+ {
+ if (this->IsModeSet(opermh))
+ this->UnOper();
+ this->SetMode(opermh, true);
+ }
this->oper = info;
LocalUser* localuser = IS_LOCAL(this);
stdalgo::vector::swaperase(ServerInstance->Users->all_opers, this);
ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER);
- this->SetMode(opermh, false);
+ if (opermh)
+ this->SetMode(opermh, false);
FOREACH_MOD(OnPostDeoper, (this));
}
++i;
c->DelUser(this);
}
-
- this->UnOper();
}
void User::WriteNotice(const std::string& text)