mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-25 18:11:27 +00:00
fix: Check if address is nil for IsValid() function.
This commit is contained in:
parent
8eb3cfe144
commit
2df418abf1
|
@ -113,7 +113,7 @@ func (d Destination) String() string {
|
||||||
|
|
||||||
// IsValid returns true if this Destination is valid.
|
// IsValid returns true if this Destination is valid.
|
||||||
func (d Destination) IsValid() bool {
|
func (d Destination) IsValid() bool {
|
||||||
return d.Network != Network_Unknown
|
return d.Address != nil && d.Network != Network_Unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
// AsDestination converts current Endpoint into Destination.
|
// AsDestination converts current Endpoint into Destination.
|
||||||
|
|
Loading…
Reference in a new issue