From 0903a9e0eca1573a425f3e21c38c9ab7879b0ecc Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Sat, 23 Nov 2013 10:05:15 -0200 Subject: [PATCH] fix bug where "follow" failed for empty users (who followed no one) --- src/twister.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/twister.cpp b/src/twister.cpp index 090512a1..bc845416 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -1595,10 +1595,9 @@ Value follow(const Array& params, bool fHelp) string username = users[u].get_str(); torrent_handle h = startTorrentUser(username); - LOCK(cs_twister); - if( h.is_valid() && m_users.count(localUser) && - !m_users[localUser].m_following.count(username) ) { - m_users[localUser].m_following.insert(username); + if( h.is_valid() ) { + LOCK(cs_twister); + m_users[localUser].m_following.insert(username); } }