summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Roster/XMPPRosterController.cpp')
-rw-r--r--Swiften/Roster/XMPPRosterController.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/Swiften/Roster/XMPPRosterController.cpp b/Swiften/Roster/XMPPRosterController.cpp
index 62bebc3..909ef8e 100644
--- a/Swiften/Roster/XMPPRosterController.cpp
+++ b/Swiften/Roster/XMPPRosterController.cpp
@@ -39,12 +39,14 @@ void XMPPRosterController::requestRoster() {
}
void XMPPRosterController::handleRosterReceived(boost::shared_ptr<RosterPayload> rosterPayload) {
- foreach(const RosterItemPayload& item, rosterPayload->getItems()) {
- //Don't worry about the updated case, the XMPPRoster sorts that out.
- if (item.getSubscription() == RosterItemPayload::Remove) {
- xmppRoster_->removeContact(item.getJID());
- } else {
- xmppRoster_->addContact(item.getJID(), item.getName(), item.getGroups(), item.getSubscription());
+ if (rosterPayload) {
+ foreach(const RosterItemPayload& item, rosterPayload->getItems()) {
+ //Don't worry about the updated case, the XMPPRoster sorts that out.
+ if (item.getSubscription() == RosterItemPayload::Remove) {
+ xmppRoster_->removeContact(item.getJID());
+ } else {
+ xmppRoster_->addContact(item.getJID(), item.getName(), item.getGroups(), item.getSubscription());
+ }
}
}
}