mirror of
https://github.com/EngineerSmith/nativefs.git
synced 2025-11-08 23:15:02 +00:00
check argument type in newFile(), fixes #4
This commit is contained in:
@@ -216,6 +216,9 @@ local nativefs = {}
|
||||
local loveC = ffi.os == 'Windows' and ffi.load('love') or C
|
||||
|
||||
function nativefs.newFile(name)
|
||||
if type(name) ~= 'string' then
|
||||
error("bad argument #1 to 'newFile' (string expected, got " .. type(name) .. ")")
|
||||
end
|
||||
return setmetatable({
|
||||
_name = name,
|
||||
_mode = 'c',
|
||||
|
||||
Reference in New Issue
Block a user