ligershark / WebOptimizer

A bundler and minifier for ASP.NET Core
Apache License 2.0
764 stars 113 forks source link

Handle implementation of IFileProvider that returns null #281

Closed belav closed 1 year ago

belav commented 1 year ago

We have a custom implementation of IFileProvider that returned null for any call to GetDirectoryContents. We don't normally deal with contents of a directory, but when WebOptimizer ran into a file it couldn't find it called provider.GetAllFiles("/") which eventually lead to a NRE. It took a bit for me to track down what was going on. Our IFileProvider now properly returns NotFoundDirectoryContents.Singleton (and is also converted to enable nullable reference types), but this change could help someone in the future from running into the same problem.

madskristensen commented 1 year ago

Thanks