diff --git a/server/doc-values/value-path.go b/server/doc-values/value-path.go index 2ca9a8c..87f79ec 100644 --- a/server/doc-values/value-path.go +++ b/server/doc-values/value-path.go @@ -47,16 +47,16 @@ func (v PathValue) GetTypeDescription() []string { } func (v PathValue) DeprecatedCheckIsValid(value string) []*InvalidValue { + if v.RequiredType == PathTypeExistenceOptional { + return nil + } + if !utils.DoesPathExist(value) { - if v.RequiredType == PathTypeExistenceOptional { - return nil - } else { - return []*InvalidValue{{ - Err: PathDoesNotExistError{}, - Start: 0, - End: uint32(len(value)), - }} - } + return []*InvalidValue{{ + Err: PathDoesNotExistError{}, + Start: 0, + End: uint32(len(value)), + }} } isValid := false