From 83b526c1580a0a4effa01b5ffb710d7dfaea1e55 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sat, 3 Sep 2011 21:23:36 +0100
Subject: Workaround for Boost empty string split bug


diff --git a/Swift/Controllers/Chat/ChatsManager.cpp b/Swift/Controllers/Chat/ChatsManager.cpp
index 56f7a4c..d631494 100644
--- a/Swift/Controllers/Chat/ChatsManager.cpp
+++ b/Swift/Controllers/Chat/ChatsManager.cpp
@@ -108,6 +108,10 @@ void ChatsManager::saveRecents() {
 	foreach (ChatListWindow::Chat chat, recentChats_) {
 		std::vector<std::string> activity;
 		boost::split(activity, chat.activity, boost::is_any_of("\t\n"));
+		if (activity.size() == 0) {
+			/* Work around Boost bug https://svn.boost.org/trac/boost/ticket/4751 */
+			activity.push_back("");
+		}
 		std::string recent = chat.jid.toString() + "\t" + activity[0] + "\t" + (chat.isMUC ? "true" : "false") +  "\t" + chat.nick;
 		recents += recent + "\n";
 		if (i++ > 25) {
-- 
cgit v0.10.2-6-g49f6