Description
The following methods throw System.NullReferenceException when their enumerationOptions parameter is null:
Directory.EnumerateFiles(String, String, EnumerationOptions)
Directory.EnumerateDirectories(String, String, EnumerationOptions)
Directory.EnumerateFileSystemEntries(String, String, EnumerationOptions)
Instead, they should throw System.ArgumentNullException when enumerationOptions parameter is null.
Reproduction Steps
Directory.EnumerateFiles(@"C:\", "*", (EnumerationOptions)null);
Expected behavior
- System.ArgumentNullException: Value cannot be null. (Parameter 'enumerationOptions')
Actual behavior
- System.NullReferenceException: Object reference not set to an instance of an object.
Regression?
No response
Known Workarounds
No response
Configuration
.NET SDK 9.0.203
Other information
No response