fix(server): ValuePath: Do not check for errors if existence is optional

This commit is contained in:
Myzel394 2025-03-22 16:15:02 +01:00
parent e2c2fac98c
commit e69edeaece
No known key found for this signature in database
GPG Key ID: 3B955307C2FC2F11

View File

@ -47,16 +47,16 @@ func (v PathValue) GetTypeDescription() []string {
} }
func (v PathValue) DeprecatedCheckIsValid(value string) []*InvalidValue { func (v PathValue) DeprecatedCheckIsValid(value string) []*InvalidValue {
if v.RequiredType == PathTypeExistenceOptional {
return nil
}
if !utils.DoesPathExist(value) { if !utils.DoesPathExist(value) {
if v.RequiredType == PathTypeExistenceOptional { return []*InvalidValue{{
return nil Err: PathDoesNotExistError{},
} else { Start: 0,
return []*InvalidValue{{ End: uint32(len(value)),
Err: PathDoesNotExistError{}, }}
Start: 0,
End: uint32(len(value)),
}}
}
} }
isValid := false isValid := false