diff options
author | Tobias Markmann <tm@ayena.de> | 2015-12-16 17:21:17 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2015-12-16 17:21:17 (GMT) |
commit | bea3559998c0ae0a2afca566046f08d0a201c0b2 (patch) | |
tree | 1f55cbe001c054a135f891b243847306ce5e4b17 | |
parent | 6c7c1411080dceed313f8d50e43454a160707121 (diff) | |
download | swift-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
-rw-r--r-- | Swift/Controllers/Roster/RosterController.cpp | 5 |
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)); } |