mirror of
https://github.com/anope/anope.git
synced 2026-07-02 15:13:13 +02:00
Avoid duplicate entries in ReplaceCert.
This commit is contained in:
@@ -111,6 +111,14 @@ public:
|
||||
|
||||
FOREACH_MOD(OnNickEraseCert, (this->nc, oldentry));
|
||||
certmap.erase(oldentry);
|
||||
|
||||
if (std::find(this->certs.begin(), this->certs.end(), newentry) != this->certs.end())
|
||||
{
|
||||
// The cert we're upgrading to already exists.
|
||||
this->certs.erase(it);
|
||||
return;
|
||||
}
|
||||
|
||||
*it = newentry;
|
||||
certmap[newentry] = nc;
|
||||
FOREACH_MOD(OnNickAddCert, (this->nc, newentry));
|
||||
|
||||
Reference in New Issue
Block a user