fix a possible nil pointer dereference

it can happen by upgrading from very old versions
This commit is contained in:
Nicola Murino
2021-09-11 14:19:17 +02:00
parent 0eca4f1866
commit 5c34d814d6
14 changed files with 139 additions and 40 deletions

View File

@@ -293,6 +293,11 @@ func (a *Admin) HideConfidentialData() {
if a.Filters.TOTPConfig.Secret != nil {
a.Filters.TOTPConfig.Secret.Hide()
}
for _, code := range a.Filters.RecoveryCodes {
if code.Secret != nil {
code.Secret.Hide()
}
}
a.SetNilSecretsIfEmpty()
}