mirror of
https://github.com/EngineerSmith/nativefs.git
synced 2025-11-08 23:15:02 +00:00
Add type check to nativefs.getInfo()
Checks that argument #1 (path) is of type 'string'.
This commit is contained in:
@@ -392,6 +392,9 @@ local function leaf(p)
|
||||
end
|
||||
|
||||
function nativefs.getInfo(path, filtertype)
|
||||
if type(path) ~= 'string' then
|
||||
error("bad argument #1 to 'getInfo' (string expected, got " .. type(path) .. ")")
|
||||
end
|
||||
local dir = path:match("(.*[\\/]).*$") or './'
|
||||
local file = leaf(path)
|
||||
local result, err = withTempMount(dir, getInfo, file, filtertype)
|
||||
|
||||
Reference in New Issue
Block a user