commands: fix possible panic in CompletionFromList

Panic might occur if aerc.SelectedAccount() is nil

Signed-off-by: kt programs <ktprograms@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
kt programs 2022-03-15 09:55:50 +08:00 committed by Robin Jarry
parent 2a19c30879
commit a16bd05321
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ func CompletionFromList(aerc *widgets.Aerc, valid []string, args []string) []str
if len(args) == 0 {
return valid
}
return FilterList(valid, args[0], "", aerc.SelectedAccount().UiConfig().FuzzyComplete)
return FilterList(valid, args[0], "", aerc.SelectedAccountUiConfig().FuzzyComplete)
}
func GetLabels(aerc *widgets.Aerc, args []string) []string {