Skip to content

Commit

Permalink
Fix sporadic crash on startup - seen on termux
Browse files Browse the repository at this point in the history
panic: runtime error: index out of range [7] with length 7 goroutine 1 [running]:
github.com/gcla/termshark/v2/ui.makePacketListModel(0x60602f78 98,
0x400028a6a8, 0x6060300838, 0x4003de68f0, 0x40003b1fe0)
/home/builder/.termux-build/termshark/src/ui/ui.go:2289
github.com/gcla/termshark/v2/ui.updatePacketListWithData (0x60602f7898, 0x400028a6a8, 0x6060300838, 0x4003de68f0)
/home/builder/.termux-build/termshark/src/ui/ui.go:230
  • Loading branch information
gcla committed Nov 30, 2021
1 parent 4fa9320 commit 519ac74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ func makePacketListModel(psml psmlInfo, app gowid.IApp) *psmlmodel.Model {

if len(expandingModel.Comparators) > 0 {
for i, _ := range expandingModel.Comparators {
if i < len(widths) {
if i < len(widths) && i < len(cols) {
if field, ok := shark.AllowedColumnFormats[cols[i].Field.Token]; ok {
if field.Comparator != nil {
expandingModel.Comparators[i] = field.Comparator
Expand Down

0 comments on commit 519ac74

Please sign in to comment.