diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 2efbcc82f8141c..ee1e4891d6f455 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -2516,6 +2516,10 @@ proc toggle_or_diff {mode w args} { if {$last_clicked ne {}} { set lno [lindex $last_clicked 1] } else { + if {[llength $file_lists($w)] == 0} { + set last_clicked {} + return + } set lno [expr {int([lindex [$w tag ranges in_diff] 0])}] } if {$mode eq "toggle"} {