From 2af4016006aa4dbb10701fb72b9f2c20abf267d7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 30 Sep 2011 21:07:17 -0600 Subject: [PATCH] Do not error out when user clicks stop selected job with no job selected. Fixes #863766 (list index out of range after attempting to stop a job) --- src/calibre/gui2/jobs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/jobs.py b/src/calibre/gui2/jobs.py index a6011abaa0..3ebfed6743 100644 --- a/src/calibre/gui2/jobs.py +++ b/src/calibre/gui2/jobs.py @@ -500,6 +500,8 @@ class JobsDialog(QDialog, Ui_JobsDialog): def kill_job(self, *args): rows = [index.row() for index in self.jobs_view.selectionModel().selectedRows()] + return error_dialog(self, _('No job'), + _('No job selected'), show=True) if question_dialog(self, _('Are you sure?'), ngettext('Do you really want to stop the selected job?', 'Do you really want to stop all the selected jobs?',