From 69ce8a1fab623a299326503b9a243d1d0c4c86de Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 10 Feb 2023 12:06:26 +1100 Subject: [PATCH] refactor(client/api): check table type when adding options --- client/api.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/api.lua b/client/api.lua index a187995..59b0310 100644 --- a/client/api.lua +++ b/client/api.lua @@ -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