fix(scraper): coerce vim.NIL precision to nil before cache write
Problem: vim.json.decode maps JSON null to vim.NIL (userdata), but cache.set_test_cases validates precision as number|nil, causing a type error on every scrape where precision is absent. Solution: guard the precision field when building the callback table, converting vim.NIL to nil.
This commit is contained in:
parent
488260f769
commit
217476f5f3
1 changed files with 1 additions and 1 deletions
|
|
@ -237,7 +237,7 @@ function M.scrape_all_tests(platform, contest_id, callback)
|
|||
memory_mb = ev.memory_mb or 0,
|
||||
interactive = ev.interactive or false,
|
||||
multi_test = ev.multi_test or false,
|
||||
precision = ev.precision,
|
||||
precision = ev.precision ~= vim.NIL and ev.precision or nil,
|
||||
problem_id = ev.problem_id,
|
||||
})
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue