Merge pull request #133 from trainstopperd/main

fix: accessing text when no quirks selected
This commit is contained in:
Dpeta 2023-04-29 15:17:08 +02:00 committed by GitHub
commit a0ef2531c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,6 +112,11 @@ class PesterQuirkList(QtWidgets.QTreeWidget):
@QtCore.pyqtSlot()
def upShiftQuirk(self):
# We cannot move the quirk up if there are no selected quirks,
# or if there are none period.
if self.currentItem() is None:
return
found = self.findItems(
self.currentItem().text(0), QtCore.Qt.MatchFlag.MatchExactly
)
@ -150,6 +155,11 @@ class PesterQuirkList(QtWidgets.QTreeWidget):
@QtCore.pyqtSlot()
def downShiftQuirk(self):
# We cannot move the quirk down if there are no selected quirks,
# or if there are none period.
if self.currentItem() is None:
return
found = self.findItems(
self.currentItem().text(0), QtCore.Qt.MatchFlag.MatchExactly
)