From d76afb15ada0e9e29cae2d83cd35d9489a042b0c Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Fri, 7 Mar 2008 21:19:18 +1100 Subject: [PATCH] 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 --- gitk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index f2ebc600e..19325086b 100755 --- a/gitk +++ b/gitk @@ -1218,7 +1218,7 @@ proc chewcommits {} { if {$viewcomplete($curview)} { global commitidx varctok global numcommits startmsecs - global mainheadid commitinfo nullid + global mainheadid nullid if {[info exists pending_select]} { set row [first_real_row] @@ -5494,6 +5494,9 @@ proc selectline {l isnew} { $ctext conf -state normal clear_ctext set linknum 0 + if {![info exists commitinfo($id)]} { + getcommit $id + } set info $commitinfo($id) set date [formatdate [lindex $info 2]] $ctext insert end "[mc "Author"]: [lindex $info 1] $date\n" -- 2.30.2