Skip to content

Commit 5a7f577

Browse files
committed
gitk: Fix bug causing Tcl error when no commits are selected
Some of the stuff that commit 31c0eaa added to drawvisible isn't appropriate to do when we have no commits, and this was causing a Tcl error if gitk was invoked in such a fashion that no commits were selected. This fixes it by bailing out of drawvisible early if there are no commits displayed. Bug reported by Johannes Sixt. Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent e7297a1 commit 5a7f577

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4573,7 +4573,7 @@ proc drawvisible {} {
45734573

45744574
set fs [$canv yview]
45754575
set ymax [lindex [$canv cget -scrollregion] 3]
4576-
if {$ymax eq {} || $ymax == 0} return
4576+
if {$ymax eq {} || $ymax == 0 || $numcommits == 0} return
45774577
set f0 [lindex $fs 0]
45784578
set f1 [lindex $fs 1]
45794579
set y0 [expr {int($f0 * $ymax)}]

0 commit comments

Comments
 (0)