summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2011-01-14 19:33:57 (GMT)
committerKevin Smith <git@kismith.co.uk>2011-01-14 19:33:57 (GMT)
commite8c6c35936605bd40a0a61e8689e1fb415ad774a (patch)
tree26b9cc13a44bf4692da2869771dbc7bfb03b2d63
parent2957eaa033fc57414080a0c9bdebd51b67c3b047 (diff)
downloadswift-contrib-e8c6c35936605bd40a0a61e8689e1fb415ad774a.zip
swift-contrib-e8c6c35936605bd40a0a61e8689e1fb415ad774a.tar.bz2
Don't crash when reconnecting with open Chats.
Resolves: #740
-rw-r--r--Swift/Controllers/Chat/ChatController.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp
index e4a76fa..3fffbb1 100644
--- a/Swift/Controllers/Chat/ChatController.cpp
+++ b/Swift/Controllers/Chat/ChatController.cpp
@@ -180,6 +180,10 @@ void ChatController::handlePresenceChange(boost::shared_ptr<Presence> newPresenc
if (!me) {
return;
}
+ if (!newPresence) {
+ newPresence = boost::shared_ptr<Presence>(new Presence());
+ newPresence->setType(Presence::Unavailable);
+ }
lastShownStatus_ = newPresence->getShow();
chatStateTracker_->handlePresenceChange(newPresence);