From c7141bcb2e4eb33f9ea4392bc04d21c95c7bfb63 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Mon, 28 Oct 2013 19:17:50 -0200 Subject: [PATCH] prevent bencoding uninitialized entries (which causes assertion fail) --- src/twister_utils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/twister_utils.cpp b/src/twister_utils.cpp index 9e066b71..cfd72fe7 100644 --- a/src/twister_utils.cpp +++ b/src/twister_utils.cpp @@ -137,8 +137,8 @@ int saveUserData(std::string const& filename, std::map con for (i = users.begin(); i != users.end(); ++i) { UserData const &udata = i->second; - entry &userData = userDict[i->first]; if( udata.m_following.size() ) { + entry &userData = userDict[i->first]; entry &followingList = userData["following"]; BOOST_FOREACH( std::string const &n, udata.m_following) { followingList.list().push_back(n); @@ -146,6 +146,7 @@ int saveUserData(std::string const& filename, std::map con } if( udata.m_directmsg.size() ) { + entry &userData = userDict[i->first]; entry &dmDict = userData["dm"]; std::map >::const_iterator j;