summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-11-10 14:00:45 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-11-10 14:00:45 (GMT)
commitbe6fd0b4b580d81bfe33975c28ee7a939d6c6723 (patch)
treee16f211641a8c76c8e0eabf111dd7517a3a9920d
parentd38f6d1111dda81ec4c5bbf0e3c95a128ff77e62 (diff)
downloadswift-be6fd0b4b580d81bfe33975c28ee7a939d6c6723.zip
swift-be6fd0b4b580d81bfe33975c28ee7a939d6c6723.tar.bz2
Don't crash on login with pending subscription events.
Change-Id: I8459b36c92703d5cfc877a6cdd92281541d8df3a
-rw-r--r--Swift/Controllers/XMPPEvents/EventController.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Swift/Controllers/XMPPEvents/EventController.cpp b/Swift/Controllers/XMPPEvents/EventController.cpp
index 9841923..d84dfe3 100644
--- a/Swift/Controllers/XMPPEvents/EventController.cpp
+++ b/Swift/Controllers/XMPPEvents/EventController.cpp
@@ -34,7 +34,8 @@ void EventController::handleIncomingEvent(boost::shared_ptr<StanzaEvent> sourceE
/* If it's a duplicate subscription request, remove the previous request first */
if (subscriptionEvent) {
- foreach(boost::shared_ptr<StanzaEvent> existingEvent, events_) {
+ EventList existingEvents(events_);
+ foreach(boost::shared_ptr<StanzaEvent> existingEvent, existingEvents) {
boost::shared_ptr<SubscriptionRequestEvent> existingSubscriptionEvent = boost::dynamic_pointer_cast<SubscriptionRequestEvent>(existingEvent);
if (existingSubscriptionEvent) {
if (existingSubscriptionEvent->getJID() == subscriptionEvent->getJID()) {