lua interpreter upset by isnumber possibly returning nil. Check if nil to reduce warnings + safety! #3

Closed
Auios wants to merge 10 commits from Auios:_bllua_schedule_callback-checks-id-is-nil-first into master
Showing only changes of commit 74745108b6 - Show all commits

View File

@@ -653,7 +653,7 @@ function bl.unhook(pkg, name, time)
if bl._hooks[pkg][name] then
if not time then
bl._hooks[pkg][name] = nil
if table.isempty(bl._hooks[pkg]) then
if table.empty(bl._hooks[pkg]) then
bl._hooks[pkg] = nil
deactivatePackage(pkg)
end
@@ -663,7 +663,7 @@ function bl.unhook(pkg, name, time)
error('bl.unhook: argument #3: time must be nil or one of '..
'\'before\' \'after\' \'override\'', 2) end
bl._hooks[pkg][name][time] = nil
if table.isempty(bl._hooks[pkg][name]) and table.empty(bl._hooks[pkg]) then
if table.empty(bl._hooks[pkg][name]) and table.empty(bl._hooks[pkg]) then
bl._hooks[pkg] = nil
deactivatePackage(pkg)
end