Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d128503

Browse files
committedSep 14, 2015
don't send network info if ip address is broken
1 parent cfa71c3 commit d128503

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎discovery.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ func getPorts() ([]OsSerialPort, error) {
125125
arrPorts := []OsSerialPort{}
126126
go func(results chan *bonjour.ServiceEntry, exitCh chan<- bool) {
127127
for e := range results {
128-
arrPorts = append(arrPorts, OsSerialPort{Name: e.AddrIPv4.String(), IdProduct: e.Instance, IdVendor: strings.Join(e.Text[:], " "), NetworkPort: true})
128+
if e.AddrIPv4 != nil {
129+
arrPorts = append(arrPorts, OsSerialPort{Name: e.AddrIPv4.String(), IdProduct: e.Instance, IdVendor: strings.Join(e.Text[:], " "), NetworkPort: true})
130+
}
129131
}
130132
timeout <- true
131133
}(results, resolver.Exit)

0 commit comments

Comments
 (0)
Please sign in to comment.