This is a Bug while trying to retrieve element with index greater than list size.
For Eg :
set list { a b c }
llength $list = 3
lindex $list 0 = a
lindex $list 1 = b
lindex $list 2 = c
Bug : lindex $list 4 = null
WorkAround :
lindexWarn { l idx } {
if { $idx > [ llength $l ]}{
error "$idx is greater than list size"
} else { return [ lindex $l $idx ] }
}
For Eg :
set list { a b c }
llength $list = 3
lindex $list 0 = a
lindex $list 1 = b
lindex $list 2 = c
Bug : lindex $list 4 = null
WorkAround :
lindexWarn { l idx } {
if { $idx > [ llength $l ]}{
error "$idx is greater than list size"
} else { return [ lindex $l $idx ] }
}