summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Roster/GroupRosterItem.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/Swiften/Roster/GroupRosterItem.cpp b/Swiften/Roster/GroupRosterItem.cpp
index 8e4be35..bf4f838 100644
--- a/Swiften/Roster/GroupRosterItem.cpp
+++ b/Swiften/Roster/GroupRosterItem.cpp
@@ -64,11 +64,12 @@ void GroupRosterItem::removeAll() {
ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(*it);
if (contact) {
delete contact;
- }
- GroupRosterItem* group = dynamic_cast<GroupRosterItem*>(*it);
- if (group) {
- group->removeAll();
- delete group;
+ } else {
+ GroupRosterItem* group = dynamic_cast<GroupRosterItem*>(*it);
+ if (group) {
+ group->removeAll();
+ delete group;
+ }
}
it++;
}