Fix :close on terminal panic

Executing :close on a terminal would panic due to it already having been
removed.

This is also related to the fact that removing a tab doesn't check for
whether it actually found a tab to remove or not.
This commit is contained in:
Jeffas 2019-07-23 19:41:15 +01:00 committed by Drew DeVault
parent 4541519225
commit ee5b537d53
2 changed files with 5 additions and 1 deletions
commands/terminal

View file

@ -26,6 +26,5 @@ func (_ Close) Execute(aerc *widgets.Aerc, args []string) error {
}
term, _ := aerc.SelectedTab().(*widgets.Terminal)
term.Close(nil)
aerc.RemoveTab(term)
return nil
}