Skip to content

Commit

Permalink
account for empty cell selection
Browse files Browse the repository at this point in the history
  • Loading branch information
X-sam committed Jul 26, 2024
1 parent bb1da71 commit 9ab9b2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/python/main/ayab/knitprogress.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ def __stitch(self, color: int, bit: bool, alt_color: Optional[int] = None, bg_co
stitch.setBackground(QBrush(bg_color))
return stitch

def onStitchSelect(self, current: QTableWidgetItem) -> None:
def onStitchSelect(self, current: QTableWidgetItem | None) -> None:
if current is None:
self.__progbar.set_selection_label("")
return
if self.horizontalHeaderItem(current.column()).foreground().color().red() == 187:
side = "Green"
else:
Expand Down

0 comments on commit 9ab9b2b

Please sign in to comment.