Fix unlink action when repo combobox is empty. By @real-yfprojects (#1342)

Fixes #1341
This commit is contained in:
yfprojects 2022-05-30 14:46:09 +00:00 committed by GitHub
parent 422ca7f418
commit 492a3128f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -251,6 +251,10 @@ class RepoTab(RepoBase, RepoUI, BackupProfileMixin):
selected_repo_id = self.repoSelector.currentData()
selected_repo_index = self.repoSelector.currentIndex()
if selected_repo_index < 0:
# QComboBox is empty
return
repo = RepoModel.get(id=selected_repo_id)
ArchiveModel.delete().where(ArchiveModel.repo_id == repo.id).execute()
profile.repo = None