diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 304ea8112..db355c5a7 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -69,6 +69,7 @@ torrent_handle bittorrent::getTorrentHandle(const QString& hash) const{ bool bittorrent::isPaused(const QString& hash) const{ torrent_handle h = s->find_torrent(misc::fromString((hash.toStdString()))); if(!h.is_valid()){ + qDebug("/!\\ Error: Invalid handle"); return true; } return h.is_paused(); @@ -79,6 +80,7 @@ bool bittorrent::isPaused(const QString& hash) const{ void bittorrent::deleteTorrent(const QString& hash, bool permanent){ torrent_handle h = s->find_torrent(misc::fromString((hash.toStdString()))); if(!h.is_valid()){ + qDebug("/!\\ Error: Invalid handle"); return; } QString savePath = QString::fromUtf8(h.save_path().string().c_str()); @@ -207,6 +209,7 @@ void bittorrent::addTorrent(const QString& path, bool fromScanDir, const QString } if(!h.is_valid()){ // No need to keep on, it failed. + qDebug("/!\\ Error: Invalid handle"); return; } // Is this really useful and appropriate ? @@ -346,6 +349,7 @@ void bittorrent::disableDHT(){ void bittorrent::loadFilteredFiles(torrent_handle &h){ torrent_info torrentInfo = h.get_torrent_info(); if(!h.is_valid()){ + qDebug("/!\\ Error: Invalid handle"); return; } QString fileHash = QString(misc::toString(torrentInfo.info_hash()).c_str()); @@ -387,6 +391,10 @@ void bittorrent::saveFastResumeData(){ std::vector handles = s->get_torrents(); for(unsigned int i=0; ifind_torrent(misc::fromString((hash.toStdString()))); if(!h.is_valid()){ + qDebug("/!\\ Error: Invalid handle"); return false; } torrent_info torrentInfo = h.get_torrent_info(); @@ -493,7 +502,12 @@ void bittorrent::setUploadRateLimit(int rate){ void bittorrent::setGlobalRatio(float ratio){ std::vector handles = s->get_torrents(); for(unsigned int i=0; i