fix(plugins/community/chess): NaN when PAT [skip ci]

This commit is contained in:
lowlighter
2022-09-08 12:57:02 -04:00
parent 1b1478ef39
commit e973359bb4

View File

@@ -36,7 +36,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
board.loadPgn(PGN) board.loadPgn(PGN)
const moves = board.history({verbose: true}) const moves = board.history({verbose: true})
const meta = board.header() const meta = board.header()
const result = Object.fromEntries(meta.Result.split("-").map((score, i) => [i ? "black" : "white", Number(score)])) const result = Object.fromEntries(meta.Result.split("-").map((score, i) => [i ? "black" : "white", Number(score) || 0]))
//Results //Results
return {platform, meta, moves, animation, result} return {platform, meta, moves, animation, result}