Fix uncaught exception when the remove torrent button is pressed when no torrents are selected

This commit is contained in:
Andrew Resch 2009-04-23 22:55:52 +00:00
parent 45a6ea5a19
commit dbf685f178
1 changed files with 4 additions and 2 deletions

View File

@ -293,8 +293,10 @@ class MenuBar(component.Component):
def on_menuitem_remove_activate(self, data=None):
log.debug("on_menuitem_remove_activate")
from removetorrentdialog import RemoveTorrentDialog
RemoveTorrentDialog(component.get("TorrentView").get_selected_torrents()).run()
torrent_ids = component.get("TorrentView").get_selected_torrents()
if torrent_ids:
from removetorrentdialog import RemoveTorrentDialog
RemoveTorrentDialog().run()
def on_menuitem_recheck_activate(self, data=None):
log.debug("on_menuitem_recheck_activate")