Do not try to store buddies with empty name and clear m_buddies after storing
This commit is contained in:
parent
851ef18260
commit
dd9f9c48e1
1 changed files with 8 additions and 0 deletions
|
@ -86,6 +86,13 @@ RosterStorage::~RosterStorage() {
|
|||
}
|
||||
|
||||
void RosterStorage::storeBuddy(Buddy *buddy) {
|
||||
if (!buddy) {
|
||||
return;
|
||||
}
|
||||
if (buddy->getName().empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_buddies[buddy->getName()] = buddy;
|
||||
m_storageTimer->start();
|
||||
}
|
||||
|
@ -129,6 +136,7 @@ bool RosterStorage::storeBuddies() {
|
|||
// }
|
||||
}
|
||||
|
||||
m_buddies.clear();
|
||||
m_storageBackend->commitTransaction();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue