summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-08-07 14:29:08 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-08-07 14:29:08 (GMT)
commit4a5a0977f661bf5c7c34ee7aa48b35073a682203 (patch)
tree1390c41105d901f773409a6b9ce8e36a09331b35 /Swiften/Roster
parentb0b9068a9760bcdbbd3d47aa2054d5ac79d16b4d (diff)
downloadswift-contrib-4a5a0977f661bf5c7c34ee7aa48b35073a682203.zip
swift-contrib-4a5a0977f661bf5c7c34ee7aa48b35073a682203.tar.bz2
Don't crash when kicked from a MUC.
Resolves: #521
Diffstat (limited to 'Swiften/Roster')
-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++;
}