fix(font): do not crash on enter

relates to #2690
This commit is contained in:
Jan De Dobbeleer 2022-08-29 08:04:54 +02:00 committed by Jan De Dobbeleer
parent 4213be5190
commit 4f9875a8bb

View file

@ -166,6 +166,9 @@ func (m *main) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.Quit
case "enter":
if len(m.fontname) != 0 {
return m, nil
}
var font *Asset
var ok bool
if font, ok = m.list.SelectedItem().(*Asset); !ok {