From ee27edd3b1b3676b3e03b4c87af894eb84b2fa26 Mon Sep 17 00:00:00 2001 From: Markus Billharz <50644328+MarkusBillharz@users.noreply.github.com> Date: Thu, 15 May 2025 00:28:31 +0200 Subject: [PATCH] fix: handle case when selected md is nil --- ui/stash.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/stash.go b/ui/stash.go index 85b76b5..c3739b2 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -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