mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-09-15 22:10:26 +00:00
Fix some other panic
This commit is contained in:
@@ -65,6 +65,9 @@ func (v *Address) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
|
||||
func (v *Address) Build() *net.IPOrDomain {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return net.NewIPOrDomain(v.Address)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ func (c *InboundDetourConfig) Build() (*core.InboundHandlerConfig, error) {
|
||||
// TUN inbound doesn't need port configuration as it uses network interface instead
|
||||
if strings.ToLower(c.Protocol) == "tun" {
|
||||
// Skip port validation for TUN
|
||||
} else if c.ListenOn == nil {
|
||||
} else if c.ListenOn == nil || len(c.ListenOn.String()) == 0 {
|
||||
// Listen on anyip, must set PortList
|
||||
if c.PortList == nil {
|
||||
return nil, errors.New("Listen on AnyIP but no Port(s) set in InboundDetour.")
|
||||
|
||||
Reference in New Issue
Block a user