mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-24 18:01:44 +00:00
net/portmapper: fix nil pointer dereference in Client.createMapping
The EventBus in net/portmapper.Config is still optional and Client.updates can be nil. Updates #15772 Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
parent
c28fda864a
commit
c41a2d5c83
@ -508,11 +508,13 @@ func (c *Client) createMapping() {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if c.updates != nil {
|
||||||
c.updates.Publish(Mapping{
|
c.updates.Publish(Mapping{
|
||||||
External: mapping.External(),
|
External: mapping.External(),
|
||||||
Type: mapping.MappingType(),
|
Type: mapping.MappingType(),
|
||||||
GoodUntil: mapping.GoodUntil(),
|
GoodUntil: mapping.GoodUntil(),
|
||||||
})
|
})
|
||||||
|
}
|
||||||
if c.onChange != nil {
|
if c.onChange != nil {
|
||||||
go c.onChange()
|
go c.onChange()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user