Fix panic that could happen when deleting stuff really fast

This commit is contained in:
Christian Rocha 2020-12-10 17:06:01 -05:00
parent 03d93169f2
commit 426f4787e5

View file

@ -759,7 +759,12 @@ func (m *stashModel) handleDocumentBrowsing(msg tea.Msg) tea.Cmd {
break
}
t := m.selectedMarkdown().markdownType
md := m.selectedMarkdown()
if md == nil {
break
}
t := md.markdownType
if t == StashedDoc || t == ConvertedDoc {
m.selectionState = selectionPromptingDelete
}