@matheusbsbs / matheus-bagliano / commits / d76afb15ad
Fork 0

gitk: Avoid a crash in selectline if commitinfo($id) isn't set

Occasionally I see a crash in selectline with commitinfo($id) not set. This makes sure it is set by calling getcommit $id if it isn't. Signed-off-by: Paul Mackerras <paulus@samba.org>

Paul Mackerras committed Mar 7, 2008 at 21:19 UTC d76afb15ada0e9e29cae2d83cd35d9489a042b0c
1 file changed +4 -1
gitk
+4 -1
@@ -1218,7 +1218,7 @@ proc chewcommits {} {
1218 if {$viewcomplete($curview)} {
1219 global commitidx varctok
1220 global numcommits startmsecs
1221 - global mainheadid commitinfo nullid
1221 + global mainheadid nullid
1222
1223 if {[info exists pending_select]} {
1224 set row [first_real_row]
@@ -5494,6 +5494,9 @@ proc selectline {l isnew} {
5494 $ctext conf -state normal
5495 clear_ctext
5496 set linknum 0
5497 + if {![info exists commitinfo($id)]} {
5498 + getcommit $id
5499 + }
5500 set info $commitinfo($id)
5501 set date [formatdate [lindex $info 2]]
5502 $ctext insert end "[mc "Author"]: [lindex $info 1] $date\n"