fix: Panic when loading coordination override (#4152)

This was broken because of browser-only. This should fix it!

Signed-off-by: Kyle Carberry <kyle@carberry.com>

Signed-off-by: Kyle Carberry <kyle@carberry.com>
This commit is contained in:
Kyle Carberry
2022-09-22 11:03:49 -05:00
committed by GitHub
parent 764600003b
commit b77d6bdd91
2 changed files with 8 additions and 3 deletions
+5 -2
View File
@@ -405,8 +405,11 @@ func (api *API) workspaceAgentClientCoordinate(rw http.ResponseWriter, r *http.R
}
// This is used by Enterprise code to control the functionality of this route.
override := api.WorkspaceClientCoordinateOverride.Load()
if override != nil && (*override)(rw) {
return
if override != nil {
overrideFunc := *override
if overrideFunc != nil && overrideFunc(rw) {
return
}
}
api.websocketWaitMutex.Lock()
+3 -1
View File
@@ -43,7 +43,9 @@ func New(ctx context.Context, options *Options) (*API, error) {
Entitlement: codersdk.EntitlementNotEntitled,
Enabled: false,
},
auditLogs: codersdk.EntitlementNotEntitled,
auditLogs: codersdk.EntitlementNotEntitled,
browserOnly: codersdk.EntitlementNotEntitled,
scim: codersdk.EntitlementNotEntitled,
},
cancelEntitlementsLoop: cancelFunc,
}