diff --git a/scripts/application_tester/tribler_apptester/actions/change_download_files_action.py b/scripts/application_tester/tribler_apptester/actions/change_download_files_action.py index 46ade1350ed..7081505e2d1 100644 --- a/scripts/application_tester/tribler_apptester/actions/change_download_files_action.py +++ b/scripts/application_tester/tribler_apptester/actions/change_download_files_action.py @@ -36,6 +36,8 @@ def __init__(self): if tree_view.rowCount() == 0: exit_script() item = tree_view.item(randint(0, tree_view.rowCount() - 1), 0) +if not item: + exit_script() check_state = Qt.Checked if item.checkState() == Qt.Unchecked else Qt.Unchecked item.setCheckState(check_state) QMetaObject.invokeMethod(tree_view, "itemClicked", Q_ARG(QTableWidgetItem, item))