diff --git a/src/main/scala/li/cil/oc/server/component/FileSystem.scala b/src/main/scala/li/cil/oc/server/component/FileSystem.scala index 8211e7f1e..c496625a9 100644 --- a/src/main/scala/li/cil/oc/server/component/FileSystem.scala +++ b/src/main/scala/li/cil/oc/server/component/FileSystem.scala @@ -246,6 +246,11 @@ class FileSystem(val fileSystem: IFileSystem, var label: Label, val host: Option def checkHandle(args: Arguments, index: Int) = { if (args.isInteger(index)) { args.checkInteger(index) + } else if (args.isTable(index)) { + args.checkTable(index).get("handle") match { + case handle: Number => handle.intValue() + case _ => throw new IOException("bad file descriptor") + } } else args.checkAny(index) match { case handle: HandleValue => handle.handle case _ => throw new IOException("bad file descriptor")