Bugfix FS opening an invalid filepath

This commit is contained in:
Alessandro Proto 2023-02-26 16:56:32 +01:00
parent 9ed2cc1687
commit 07da11fe40

View file

@ -555,12 +555,20 @@ public class FileSystem : IComponent
} }
} }
var fileStream = File.Open(path, fileMode, fileAccess, FileShare.ReadWrite | FileShare.Delete); try
{
var fileStream = File.Open(path, fileMode, fileAccess, FileShare.ReadWrite | FileShare.Delete);
ObjectManager.PushObject(L, fileStream); ObjectManager.PushObject(L, fileStream);
L.SetMetaTable(FileHandle.ObjectType); L.SetMetaTable(FileHandle.ObjectType);
return 1; return 1;
}
catch (Exception ex)
{
L.Error(ex.Message);
}
return 0;
} }
} }