From fce1d5be19d81b144fdd242799dc699ee1291369 Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Fri, 30 Oct 2026 17:19:38 +0530 Subject: Type check individual segment/section entry. --- mkelf.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mkelf.lua') diff --git a/mkelf.lua b/mkelf.lua index 3ad7dba..b7c693a 100644 --- a/mkelf.lua +++ b/mkelf.lua @@ -43,6 +43,9 @@ local function loadconfig(fn) error("segments must be a table", 2) end for _, segment in ipairs(t) do + if type(segment) ~= "table" then + error("segment must be a table", 2) + end segment = setmetatable(segment, segment_mt) segment:normalize() segment:validate() @@ -54,6 +57,9 @@ local function loadconfig(fn) error("sections must be a table", 2) end for _, section in ipairs(t) do + if type(section) ~= "table" then + error("section must be a table", 2) + end section = setmetatable(section, section_mt) section:normalize() section:validate() -- cgit v1.3