Skip to content

Commit

Permalink
fix: #36 crash when beginTTL is specific.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjlleo committed Jun 18, 2022
1 parent f11f9c8 commit c9ebf74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion printer/realtime_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func findLatestAvailableHop(res *trace.Result, ttl int, probesIndex int) int {
// 查找上一个跃点是不是有效结果
ttl--
// 判断此TTL跃点是否有效并判断地理位置结构体是否已经初始化
if res.Hops[ttl][probesIndex].Success && res.Hops[ttl][probesIndex].Geo != nil {
if len(res.Hops[ttl]) != 0 && res.Hops[ttl][probesIndex].Success && res.Hops[ttl][probesIndex].Geo != nil {
// TTL虽有效,但地理位置API没有能够正确返回数据,依旧不能视为有效数据
if res.Hops[ttl][probesIndex].Geo.Country == "" {
// 跳过继续寻找上一个有效跃点
Expand Down

0 comments on commit c9ebf74

Please sign in to comment.