try to catch invalid handle in deluge_core

This commit is contained in:
Marcos Pinto 2007-11-25 23:59:19 +00:00
parent e0367895b7
commit fd7d1ce675

View File

@ -1787,6 +1787,7 @@ static PyObject *torrent_replace_trackers(PyObject *self, PyObject *args)
if (PyErr_Occurred())
return NULL;
try {
if (M_torrents->at(index).handle.is_valid()){
std::vector<libtorrent::announce_entry> trackerlist;
std::istringstream trackers(tracker);
@ -1804,6 +1805,8 @@ static PyObject *torrent_replace_trackers(PyObject *self, PyObject *args)
M_torrents->at(index).handle.force_reannounce();
}
}
}
catch (libtorrent::invalid_handle&) {}
Py_INCREF(Py_None); return Py_None;
}
static PyObject *torrent_prioritize_files(PyObject *self, PyObject *args)