From c6a4c6ebc1cb65e09b6b80027d05086b9f705fd3 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 6 Mar 2026 19:53:38 -0500 Subject: [PATCH] fix(cache): skip non-table entries in `get_contest_summaries` Problem: `set_contest_summaries` stores `supports_countdown` as a boolean directly under the platform key. `get_contest_summaries` only filtered keys starting with `_`, so it iterated the boolean and crashed indexing it as a table. Solution: add `type(contest_data) == 'table'` guard to the loop. --- lua/cp/cache.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cp/cache.lua b/lua/cp/cache.lua index b596671..691dc82 100644 --- a/lua/cp/cache.lua +++ b/lua/cp/cache.lua @@ -379,7 +379,7 @@ end function M.get_contest_summaries(platform) local contest_list = {} for contest_id, contest_data in pairs(cache_data[platform] or {}) do - if contest_id:sub(1, 1) ~= '_' then + if type(contest_data) == 'table' and contest_id:sub(1, 1) ~= '_' then table.insert(contest_list, { id = contest_id, name = contest_data.name,