From 37ad5d3eb91aae70152fbe80168b70189446fdca Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 20 Jan 2025 22:50:18 +0530 Subject: [PATCH] Fix traceback when clicking in empty part of rules list --- src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py b/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py index 277c45db3a..7a668a2345 100644 --- a/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py +++ b/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py @@ -100,6 +100,8 @@ class TbIconRulesTab(ConfigTabWidget, Ui_Form): def show_context_menu(self, point): clicked_item = self.rules_table.itemAt(point) + if clicked_item is None: + return item = self.rules_table.item(clicked_item.row(), CATEGORY_COLUMN) m = QMenu(self) ac = m.addAction(_('Delete this rule'), partial(self.context_menu_handler, 'delete', item))