mirror of https://github.com/borgbase/vorta
Fix unlink action when repo combobox is empty. By @real-yfprojects (#1342)
Fixes #1341
This commit is contained in:
parent
422ca7f418
commit
492a3128f8
|
@ -251,6 +251,10 @@ class RepoTab(RepoBase, RepoUI, BackupProfileMixin):
|
||||||
selected_repo_id = self.repoSelector.currentData()
|
selected_repo_id = self.repoSelector.currentData()
|
||||||
selected_repo_index = self.repoSelector.currentIndex()
|
selected_repo_index = self.repoSelector.currentIndex()
|
||||||
|
|
||||||
|
if selected_repo_index < 0:
|
||||||
|
# QComboBox is empty
|
||||||
|
return
|
||||||
|
|
||||||
repo = RepoModel.get(id=selected_repo_id)
|
repo = RepoModel.get(id=selected_repo_id)
|
||||||
ArchiveModel.delete().where(ArchiveModel.repo_id == repo.id).execute()
|
ArchiveModel.delete().where(ArchiveModel.repo_id == repo.id).execute()
|
||||||
profile.repo = None
|
profile.repo = None
|
||||||
|
|
Loading…
Reference in New Issue