fix: handle case when selected md is nil

This commit is contained in:
Markus Billharz 2025-05-15 00:28:31 +02:00 committed by Christian Rocha
commit ee27edd3b1

View file

@ -518,6 +518,12 @@ func (m *stashModel) handleDocumentBrowsing(msg tea.Msg) tea.Cmd {
// Edit document in EDITOR
case "e":
md := m.selectedMarkdown()
// In case no file is available
if md == nil {
return nil
}
return openEditor(md.localPath, 0)
// Open document