Give a better error in LocalFileSystem when trying to initialize it with a file

This commit is contained in:
Alex Barney 2019-11-11 12:03:22 -06:00
parent fcf46b1822
commit f99bc3e0fe

View file

@ -21,6 +21,11 @@ namespace LibHac.FsSystem
if (!Directory.Exists(BasePath)) if (!Directory.Exists(BasePath))
{ {
if (File.Exists(BasePath))
{
throw new DirectoryNotFoundException($"The specified path is a file. ({basePath})");
}
Directory.CreateDirectory(BasePath); Directory.CreateDirectory(BasePath);
} }
} }