summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-12-16 17:21:17 (GMT)
committerTobias Markmann <tm@ayena.de>2015-12-16 17:21:17 (GMT)
commitbea3559998c0ae0a2afca566046f08d0a201c0b2 (patch)
tree1f55cbe001c054a135f891b243847306ce5e4b17 /Swift/Controllers
parent6c7c1411080dceed313f8d50e43454a160707121 (diff)
downloadswift-bea3559998c0ae0a2afca566046f08d0a201c0b2.zip
swift-bea3559998c0ae0a2afca566046f08d0a201c0b2.tar.bz2
Fix crash related to removal of contacts
Test-Information: Added test@example.com contact and removed it afterwards. Without this patch Swift crashed. With the patch it does not anymore. Change-Id: I09e93340cb0a23291ab094a4cdb7c79ef719645a
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/Roster/RosterController.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Swift/Controllers/Roster/RosterController.cpp b/Swift/Controllers/Roster/RosterController.cpp
index 75acaa9..4fbdea4 100644
--- a/Swift/Controllers/Roster/RosterController.cpp
+++ b/Swift/Controllers/Roster/RosterController.cpp
@@ -334,6 +334,11 @@ void RosterController::handleIncomingPresence(Presence::ref newPresence) {
return;
}
Presence::ref accountPresence = presenceOracle_->getAccountPresence(newPresence->getFrom().toBare());
+ if (!accountPresence) {
+ accountPresence = Presence::create();
+ accountPresence->setFrom(newPresence->getFrom());
+ accountPresence->setType(Presence::Unavailable);
+ }
roster_->applyOnItems(SetPresence(accountPresence));
}