From 4403503d827655cc19e8fa1282da16a36b45fe7c Mon Sep 17 00:00:00 2001 From: Matt Hook Date: Tue, 23 Apr 2024 12:58:21 +1200 Subject: [PATCH] fix(settings): fix crash during settings update when not using oauth [EE-7031] (#11661) --- api/http/handler/settings/settings_update.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/http/handler/settings/settings_update.go b/api/http/handler/settings/settings_update.go index 2b9ceb5c3..eff0eb93b 100644 --- a/api/http/handler/settings/settings_update.go +++ b/api/http/handler/settings/settings_update.go @@ -96,8 +96,10 @@ func (payload *settingsUpdatePayload) Validate(r *http.Request) error { } } - if payload.OAuthSettings.AuthStyle < oauth2.AuthStyleAutoDetect || payload.OAuthSettings.AuthStyle > oauth2.AuthStyleInHeader { - return errors.New("Invalid OAuth AuthStyle") + if payload.OAuthSettings != nil { + if payload.OAuthSettings.AuthStyle < oauth2.AuthStyleAutoDetect || payload.OAuthSettings.AuthStyle > oauth2.AuthStyleInHeader { + return errors.New("Invalid OAuth AuthStyle") + } } return nil }