mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Fixed runtime crash on fs.delete deleting full directory not recursively
This commit is contained in:
parent
c278d997ff
commit
17056b3269
1 changed files with 5 additions and 0 deletions
|
@ -414,6 +414,11 @@ public class FileSystem : IPlugin
|
||||||
var attr = File.GetAttributes(path);
|
var attr = File.GetAttributes(path);
|
||||||
if (attr.HasFlag(FileAttributes.Directory))
|
if (attr.HasFlag(FileAttributes.Directory))
|
||||||
{
|
{
|
||||||
|
if(!recursive && Directory.GetFileSystemEntries(path).Any())
|
||||||
|
{
|
||||||
|
L.Error("directory not empty");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Directory.Delete(path, recursive);
|
Directory.Delete(path, recursive);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue