소스 검색

WebAdmin SMTP: ensure current config is not nil

Signed-off-by: Nicola Murino <[email protected]>
Nicola Murino 1 년 전
부모
커밋
7d24a4852c
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      internal/httpd/webadmin.go

+ 3 - 0
internal/httpd/webadmin.go

@@ -4316,6 +4316,9 @@ func (s *httpdServer) handleOAuth2TokenRedirect(w http.ResponseWriter, r *http.R
 }
 
 func updateSMTPSecrets(newConfigs, currentConfigs *dataprovider.SMTPConfigs) {
+	if currentConfigs == nil {
+		currentConfigs = &dataprovider.SMTPConfigs{}
+	}
 	if newConfigs.Password.IsNotPlainAndNotEmpty() {
 		newConfigs.Password = currentConfigs.Password
 	}