mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20:55 +03:00
admin: fix possible nil pointer dereference
this possible bug was introduced in the previous commit
This commit is contained in:
@@ -305,7 +305,7 @@ func (a *Admin) SetEmptySecretsIfNil() {
|
||||
// This is useful before rendering as JSON so the empty fields
|
||||
// will not be serialized.
|
||||
func (a *Admin) SetNilSecretsIfEmpty() {
|
||||
if a.Filters.TOTPConfig.Secret.IsEmpty() {
|
||||
if a.Filters.TOTPConfig.Secret != nil && a.Filters.TOTPConfig.Secret.IsEmpty() {
|
||||
a.Filters.TOTPConfig.Secret = nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user