1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 02:03:13 +02:00

Remove duplicate objects from corrupt databases on database write.

This commit is contained in:
Sadie Powell
2026-04-23 18:13:20 +01:00
parent 9b8570a2ee
commit 6c7977f239
7 changed files with 38 additions and 4 deletions
+2 -2
View File
@@ -31,11 +31,11 @@ NickCore::NickCore(const Anope::string &coredisplay, uint64_t coreid)
if (coredisplay.empty())
throw CoreException("Empty display passed to NickCore constructor");
if (!NickCoreList->insert_or_assign(this->display, this).second)
if (!this->InsertUnique(*NickCoreList, this->display))
Log(LOG_DEBUG) << "Duplicate account " << this->display << " in NickCore table";
// Upgrading users may not have an account identifier.
if (this->uniqueid && !NickCoreIdList->insert_or_assign(this->uniqueid, this).second)
if (this->uniqueid && !this->InsertUnique(*NickCoreIdList, this->uniqueid))
Log(LOG_DEBUG) << "Duplicate account id " << this->uniqueid << " in NickCore table";
FOREACH_MOD(OnNickCoreCreate, (this));