diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 584ceea65..6ef664e6f 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -1576,8 +1576,10 @@ bool Session::addTorrent(QString source, const AddTorrentParams ¶ms) } else { TorrentFileGuard guard(source); - guard.markAsAddedToSession(); - return addTorrent_impl(params, MagnetUri(), TorrentInfo::loadFromFile(source)); + if (addTorrent_impl(params, MagnetUri(), TorrentInfo::loadFromFile(source))) { + guard.markAsAddedToSession(); + return true; + } } return false;