From 7d24a4852c07d4f9179c91b52c7c4913dd7b58bf Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Tue, 15 Oct 2024 18:23:28 +0200 Subject: [PATCH] WebAdmin SMTP: ensure current config is not nil Signed-off-by: Nicola Murino --- internal/httpd/webadmin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/httpd/webadmin.go b/internal/httpd/webadmin.go index 778b6d745..00b3a6963 100644 --- a/internal/httpd/webadmin.go +++ b/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 }