Skip to content

LegalFilePathsOnly() should not allow empty string #1688

Closed
@therealchjones

Description

@therealchjones

public static TArgument LegalFileNamesOnly<TArgument>(

The argument validator LegalFilePathsOnly() (and the associated option extension) checks for disallowed characters such as path separators in the argument. However, empty strings are not caught by this validator, and when used for a FileInfo, FileSystemInfo, or DirectoryInfo option, the empty argument throws an exception. It would seem reasonable that rather than add a custom validator or parser, LegalFilePathsOnly() would create an error with such an argument.

Happy to work on PR if all agree.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions