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