1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-02 22:25:47 +02:00

defend against possible nil function

This commit is contained in:
Jesse Duffield 2022-12-30 22:49:08 +11:00
parent 6c3671f807
commit 5c42e1a5dc

View File

@ -290,8 +290,13 @@ func (gui *Gui) clearConfirmationViewKeyBindings() {
func (gui *Gui) refreshSuggestions() {
gui.suggestionsAsyncHandler.Do(func() func() {
suggestions := gui.findSuggestions(gui.c.GetPromptInput())
return func() { gui.setSuggestions(suggestions) }
findSuggestionsFn := gui.findSuggestions
if findSuggestionsFn != nil {
suggestions := gui.findSuggestions(gui.c.GetPromptInput())
return func() { gui.setSuggestions(suggestions) }
} else {
return func() {}
}
})
}