diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-27 20:10:25 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-27 21:25:04 +1100 |
commit | 84a19920559f940b391ab3f19686e2e85039e083 (patch) | |
tree | 479b356263b51bd93831c8e98f479d9b8b722a2c /pkg/gui/mergeconflicts/state.go | |
parent | 7f85bf556322eb5996b63182bbf775db68987bae (diff) |
better locking of merge panel state
Diffstat (limited to 'pkg/gui/mergeconflicts/state.go')
-rw-r--r-- | pkg/gui/mergeconflicts/state.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/gui/mergeconflicts/state.go b/pkg/gui/mergeconflicts/state.go index 0889aaf41..d84f05545 100644 --- a/pkg/gui/mergeconflicts/state.go +++ b/pkg/gui/mergeconflicts/state.go @@ -155,7 +155,13 @@ func (s *State) Active() bool { } func (s *State) GetConflictMiddle() int { - return s.currentConflict().target + currentConflict := s.currentConflict() + + if currentConflict == nil { + return 0 + } + + return currentConflict.target } func (s *State) ContentAfterConflictResolve(selection Selection) (bool, string, error) { |