diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-01-14 19:33:57 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-01-14 19:33:57 (GMT) |
commit | e8c6c35936605bd40a0a61e8689e1fb415ad774a (patch) | |
tree | 26b9cc13a44bf4692da2869771dbc7bfb03b2d63 /Swift | |
parent | 2957eaa033fc57414080a0c9bdebd51b67c3b047 (diff) | |
download | swift-e8c6c35936605bd40a0a61e8689e1fb415ad774a.zip swift-e8c6c35936605bd40a0a61e8689e1fb415ad774a.tar.bz2 |
Don't crash when reconnecting with open Chats.
Resolves: #740
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/Controllers/Chat/ChatController.cpp | 4 |
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); |