Skip to content

Commit

Permalink
micro: Don't forward nil events into the sub event handler (#2992)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKar authored Mar 12, 2024
1 parent c15abea commit 0de1633
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/micro/micro.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ func DoEvent() {
os.Exit(0)
}

if event == nil {
return
}

if e, ok := event.(*tcell.EventError); ok {
log.Println("tcell event error: ", e.Error())

Expand All @@ -469,12 +473,10 @@ func DoEvent() {
}

ulua.Lock.Lock()
// if event != nil {
if action.InfoBar.HasPrompt {
action.InfoBar.HandleEvent(event)
} else {
action.Tabs.HandleEvent(event)
}
// }
ulua.Lock.Unlock()
}

0 comments on commit 0de1633

Please sign in to comment.