Skip to content

Commit

Permalink
refactor(client/api): check table type when adding options
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Feb 10, 2023
1 parent b3948f4 commit 69ce8a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ local function addTarget(target, options, resource)
TypeError('options', 'table', optionsType)
end

local tableType = table.type(options)

if tableType ~= 'array' then
TypeError('options', 'array', ('%s table'):format(tableType))
end

local num = #target

for i = 1, #options do
Expand Down

0 comments on commit 69ce8a1

Please sign in to comment.