mirror of
https://github.com/Ale32bit/Capy64.git
synced 2025-01-18 18:46:43 +00:00
Bugfix crash unauthorized delete
This commit is contained in:
parent
b09ab4bdff
commit
fa39689e3a
1 changed files with 15 additions and 8 deletions
|
@ -426,6 +426,8 @@ public class FileSystem : IComponent
|
||||||
L.Error("path not found");
|
L.Error("path not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
var attr = File.GetAttributes(path);
|
var attr = File.GetAttributes(path);
|
||||||
if (attr.HasFlag(FileAttributes.Directory))
|
if (attr.HasFlag(FileAttributes.Directory))
|
||||||
{
|
{
|
||||||
|
@ -440,6 +442,11 @@ public class FileSystem : IComponent
|
||||||
{
|
{
|
||||||
File.Delete(path);
|
File.Delete(path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return L.Error(e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue