From d64736056fa450d3b1b05dad8ea3da4be41976bf Mon Sep 17 00:00:00 2001 From: V1K1NGbg Date: Sun, 4 Aug 2024 15:26:27 +0300 Subject: type_check --- src/luarocks/type_check.lua | 6 ++++-- src/luarocks/type_check.tl | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/luarocks/type_check.lua b/src/luarocks/type_check.lua index d4fec1bf..a99ec691 100644 --- a/src/luarocks/type_check.lua +++ b/src/luarocks/type_check.lua @@ -31,8 +31,10 @@ type_check.MAGIC_PLATFORMS = {} do local function fill_in_version(tbl, version) for _, v in pairs(tbl.fields) do - if v._version == nil then - v._version = version + if type(v) == "table" then + if v._version == nil then + v._version = version + end fill_in_version(v) end end diff --git a/src/luarocks/type_check.tl b/src/luarocks/type_check.tl index 0f3bde2d..a51fa932 100644 --- a/src/luarocks/type_check.tl +++ b/src/luarocks/type_check.tl @@ -31,9 +31,11 @@ type_check.MAGIC_PLATFORMS = {} do local function fill_in_version(tbl: TableSchema, version?: string) for _, v in pairs(tbl.fields) do - if v._version == nil then - v._version = version - fill_in_version(v) + if v is TableSchema then + if v._version == nil then + v._version = version + end + fill_in_version(v) end end end -- cgit v1.2.3-55-g6feb