fix folders validation

Fixes #510
This commit is contained in:
Nicola Murino 2021-08-19 11:33:00 +02:00
parent 89bc50aa81
commit d03020e2b8
No known key found for this signature in database
GPG key ID: 2F1FB59433D5A8CB

View file

@ -1560,6 +1560,7 @@ func createUserPasswordHash(user *User) error {
// ValidateFolder returns an error if the folder is not valid // ValidateFolder returns an error if the folder is not valid
// FIXME: this should be defined as Folder struct method // FIXME: this should be defined as Folder struct method
func ValidateFolder(folder *vfs.BaseVirtualFolder) error { func ValidateFolder(folder *vfs.BaseVirtualFolder) error {
folder.FsConfig.SetEmptySecretsIfNil()
if folder.Name == "" { if folder.Name == "" {
return &ValidationError{err: "folder name is mandatory"} return &ValidationError{err: "folder name is mandatory"}
} }