fix: nil ptr dereference when removing a license (#12785)

This commit is contained in:
Colin Adler 2024-03-27 15:59:35 -05:00 committed by GitHub
parent 5235faa79f
commit dc8cf3eea5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -657,7 +657,9 @@ func (api *API) updateEntitlements(ctx context.Context) error {
})
} else {
coordinator = agpltailnet.NewCoordinator(api.Logger)
api.derpMesh.SetAddresses([]string{}, false)
if api.Options.DeploymentValues.DERP.Server.Enable {
api.derpMesh.SetAddresses([]string{}, false)
}
api.replicaManager.SetCallback(func() {
// If the amount of replicas change, so should our entitlements.
// This is to display a warning in the UI if the user is unlicensed.