Assert if index is invalid in delete_cur_item.
CompletionView already checks the index, so an error here shouldn't happen.
This commit is contained in:
parent
fd07c571e5
commit
1e489325c4
@ -215,10 +215,10 @@ class CompletionModel(QAbstractItemModel):
|
||||
|
||||
def delete_cur_item(self, index):
|
||||
"""Delete the row at the given index."""
|
||||
qtutils.ensure_valid(index)
|
||||
parent = index.parent()
|
||||
cat = self._cat_from_idx(parent)
|
||||
if not cat:
|
||||
raise cmdexc.CommandError("No category selected")
|
||||
assert cat, "CompletionView sent invalid index for deletion"
|
||||
self.beginRemoveRows(parent, index.row(), index.row())
|
||||
cat.delete_cur_item(cat.index(index.row(), 0))
|
||||
self.endRemoveRows()
|
||||
|
Loading…
Reference in New Issue
Block a user