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:
parent
6c3671f807
commit
5c42e1a5dc
@ -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() {}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user