From 09d8a4797d4597268e1807d23efc6cc034b4c48e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 17 Aug 2009 05:50:47 +0000 Subject: [PATCH] - Make sure torrent handle is valid before updating the torrent --- src/FinishedTorrents.cpp | 1 + src/downloadingTorrents.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/FinishedTorrents.cpp b/src/FinishedTorrents.cpp index d9513b89c..947f7d466 100644 --- a/src/FinishedTorrents.cpp +++ b/src/FinishedTorrents.cpp @@ -279,6 +279,7 @@ void FinishedTorrents::updateMetadata(QTorrentHandle &h) { } void FinishedTorrents::updateTorrent(QTorrentHandle h) { + if(!h.is_valid()) return; QString hash = h.hash(); int row = getRowFromHash(hash); if(row == -1){ diff --git a/src/downloadingTorrents.cpp b/src/downloadingTorrents.cpp index 575da896b..8d03587eb 100644 --- a/src/downloadingTorrents.cpp +++ b/src/downloadingTorrents.cpp @@ -505,6 +505,7 @@ void DownloadingTorrents::updateMetadata(QTorrentHandle &h) { // get information from torrent handles and // update download list accordingly bool DownloadingTorrents::updateTorrent(QTorrentHandle h) { + if(!h.is_valid()) return false; bool added = false; try{ QString hash = h.hash();