Skip to content

Commit

Permalink
Check list has members before trying to delete one
Browse files Browse the repository at this point in the history
Closes #261 on github. Scrollable with no display list members
and no "lastline" will have cursor=None, and this must be
checked for explicitly before allowing a further deletion.
  • Loading branch information
sde1000 committed Jun 16, 2023
1 parent 9296cda commit 81cd278
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quicktill/stocklines.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, stocklines=None,
headerline])

def keypress(self, k):
if k == keyboard.K_CANCEL and self.s:
if k == keyboard.K_CANCEL and self.s and self.s.cursor is not None:
line = self.s.dl.pop(self.s.cursor)
self.s.redraw()
td.s.add(line.userdata)
Expand Down

0 comments on commit 81cd278

Please sign in to comment.