1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-17 21:18:31 +02:00

defend against view not yet having a context defined against it

This commit is contained in:
Jesse Duffield 2022-02-13 10:57:30 +11:00
parent 41527270ed
commit 94d66b267d

View File

@ -181,7 +181,12 @@ func (gui *Gui) activateContext(c types.Context, opts ...types.OnFocusOpts) erro
if err != nil {
return err
}
originalViewContextKey := gui.State.ViewContextMap.Get(viewName).GetKey()
originalViewContext := gui.State.ViewContextMap.Get(viewName)
var originalViewContextKey types.ContextKey = ""
if originalViewContext != nil {
originalViewContextKey = originalViewContext.GetKey()
}
gui.setWindowContext(c)
gui.setViewTabForContext(c)