Fixed length check on function name in `expect` (#589)

This commit is contained in:
JackMacWindows 2020-11-26 14:46:03 -05:00 committed by GitHub
parent fff8353451
commit 486f41f082
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ local function expect(index, value, ...)
local name
if native_type(debug) == "table" and native_type(debug.getinfo) == "function" then
local ok, info = pcall(debug.getinfo, 3, "nS")
if ok and info.name and #info.name ~= "" and info.what ~= "C" then name = info.name end
if ok and info.name and info.name ~= "" and info.what ~= "C" then name = info.name end
end
local type_names = get_type_names(...)