mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-01 23:19:18 +03:00
Simplify code
This avoids "deferencing null pointer" warning from static analyzers.
This commit is contained in:
parent
c7f1f1494e
commit
42eac2ee3c
1 changed files with 2 additions and 2 deletions
|
@ -2204,8 +2204,8 @@ bool Session::addTorrent_impl(CreateTorrentParams params, const MagnetUri &magne
|
|||
// processed or adding to session
|
||||
if (m_addingTorrents.contains(hash) || m_loadedMetadata.contains(hash)) return false;
|
||||
|
||||
if (m_torrents.contains(hash)) {
|
||||
TorrentHandle *const torrent = m_torrents.value(hash);
|
||||
TorrentHandle *const torrent = m_torrents.value(hash);
|
||||
if (torrent) {
|
||||
if (torrent->isPrivate() || (!fromMagnetUri && torrentInfo.isPrivate()))
|
||||
return false;
|
||||
torrent->addTrackers(fromMagnetUri ? magnetUri.trackers() : torrentInfo.trackers());
|
||||
|
|
Loading…
Reference in a new issue