From 736fa2fe5f8053fa645c4a0cfd4e75cdf3af1fbf Mon Sep 17 00:00:00 2001 From: Colin Adler Date: Wed, 27 Mar 2024 20:47:00 +0000 Subject: [PATCH] fix: nil ptr dereference when removing a license --- enterprise/coderd/coderd.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/enterprise/coderd/coderd.go b/enterprise/coderd/coderd.go index 7791959a87e20..47759b194261d 100644 --- a/enterprise/coderd/coderd.go +++ b/enterprise/coderd/coderd.go @@ -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.