mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
UDS: prevent crash when proxy udp (#3967)
* net: Prevent nil pointer err in NetAddr() * Fix dsworker saddr problem
This commit is contained in:
parent
ccc4b7b2cf
commit
057e6284b2
2 changed files with 8 additions and 5 deletions
|
@ -89,10 +89,12 @@ func UnixDestination(address Address) Destination {
|
|||
// NetAddr returns the network address in this Destination in string form.
|
||||
func (d Destination) NetAddr() string {
|
||||
addr := ""
|
||||
if d.Network == Network_TCP || d.Network == Network_UDP {
|
||||
addr = d.Address.String() + ":" + d.Port.String()
|
||||
} else if d.Network == Network_UNIX {
|
||||
addr = d.Address.String()
|
||||
if d.Address != nil {
|
||||
if d.Network == Network_TCP || d.Network == Network_UDP {
|
||||
addr = d.Address.String() + ":" + d.Port.String()
|
||||
} else if d.Network == Network_UNIX {
|
||||
addr = d.Address.String()
|
||||
}
|
||||
}
|
||||
return addr
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue