1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

deal with the fact that a nil wrapped in an interface is not equal to nil

This commit is contained in:
Jesse Duffield
2020-08-22 15:56:30 +10:00
parent e290710f67
commit 5874529f43
6 changed files with 91 additions and 64 deletions

View File

@ -60,8 +60,8 @@ func (gui *Gui) currentDiffTerminals() []string {
if context == nil {
return nil
}
item := context.GetSelectedItem()
if item == nil {
item, ok := context.GetSelectedItem()
if !ok {
return nil
}
return []string{item.ID()}
@ -79,11 +79,7 @@ func (gui *Gui) currentDiffTerminal() string {
func (gui *Gui) currentlySelectedFilename() string {
switch gui.currentContextKey() {
case FILES_CONTEXT_KEY, COMMIT_FILES_CONTEXT_KEY:
item := gui.getSideContextSelectedItem()
if item == nil {
return ""
}
return item.ID()
return gui.getSideContextSelectedItemId()
default:
return ""
}