mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-19 06:34:18 +02:00
Fix panic when deleting item at end of stash
This commit is contained in:
parent
ea12614a53
commit
939fdef913
1 changed files with 1 additions and 1 deletions
|
|
@ -132,7 +132,7 @@ func (m stashModel) markdownIndex() int {
|
|||
|
||||
// return the current selected markdown in the stash
|
||||
func (m stashModel) selectedMarkdown() *markdown {
|
||||
if len(m.markdowns) == 0 {
|
||||
if len(m.markdowns) == 0 || len(m.markdowns) <= m.markdownIndex() {
|
||||
return nil
|
||||
}
|
||||
return m.markdowns[m.markdownIndex()]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue