Skip to content

Commit 9726a3f

Browse files
committed
Traceroute.Reply.Err
- `traceroute/reply`: Fix #28: `Err()`: return empty string if `Err` is not a `string`
1 parent 9ad3c83 commit 9726a3f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

measurement/traceroute/reply.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ func (r *Reply) X() string {
6262
// "A" (administratively prohibited), "P" (protocol unreachable),
6363
// "p" (port unreachable) "h" (beyond scope, from fw 4650) (optional).
6464
func (r *Reply) Err() string {
65-
return r.data.Err.(string)
65+
if err, ok := r.data.Err.(string); ok {
66+
return err
67+
}
68+
return ""
6669
}
6770

6871
// IPv4 or IPv6 source address in reply.

0 commit comments

Comments
 (0)