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:
@ -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 ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user