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.
This commit is contained in:
parent
425a8f36e9
commit
c6a4c6ebc1
1 changed files with 1 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue