summaryrefslogtreecommitdiffstats
path: root/pkg/gui/diffing.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-22 15:56:30 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit5874529f4310c6b4b0abdfcef714ff6f6cc8afd5 (patch)
tree3a225e081659c52cd548cace154f2f2c64f2894b /pkg/gui/diffing.go
parente290710f6741c046ee7e52e622af813e8955639b (diff)
deal with the fact that a nil wrapped in an interface is not equal to nil
Diffstat (limited to 'pkg/gui/diffing.go')
-rw-r--r--pkg/gui/diffing.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/pkg/gui/diffing.go b/pkg/gui/diffing.go
index b334fe768..06d19959c 100644
--- a/pkg/gui/diffing.go
+++ b/pkg/gui/diffing.go
@@ -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 ""
}