mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
check on table type in table.all
This commit is contained in:
parent
489ef050b2
commit
e7540033af
1 changed files with 5 additions and 0 deletions
|
|
@ -3877,10 +3877,15 @@ end
|
|||
--- @return boolean
|
||||
function table.all(t, predicate)
|
||||
|
||||
if type(t) ~= 'table' then
|
||||
traceError(TRACE_DEBUG, TRACE_CONSOLE, "the first paramater is not a table!")
|
||||
return false
|
||||
end
|
||||
if type(predicate) ~= 'function' then
|
||||
traceError(TRACE_DEBUG, TRACE_CONSOLE, "the passed predicate is not a function!")
|
||||
return false
|
||||
end
|
||||
|
||||
if t == nil then return false end
|
||||
|
||||
for _, value in pairs(t) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue