fixed breakage when parsing one-map games
This commit is contained in:
parent
3b93b05230
commit
85e9c52f8d
10
sk0r.js
10
sk0r.js
|
@ -72,8 +72,12 @@ function update_scores(hltv_url) {
|
|||
if (score_row.className === "livescore twoRowExtraRow") {
|
||||
var score_el = score_row.querySelector("[data-livescore-current-map-score='']");
|
||||
var maps_won_el = score_row.querySelector("[data-livescore-maps-won-for='']");
|
||||
rounds_won.push(score_el.innerText);
|
||||
maps_won.push(maps_won_el.innerText);
|
||||
if (score_el !== null) {
|
||||
rounds_won.push(score_el.innerText);
|
||||
}
|
||||
if (maps_won_el !== null) {
|
||||
maps_won.push(maps_won_el.innerText);
|
||||
}
|
||||
} else if (score_row.className.includes("twoRowExtraRow won") ||
|
||||
score_row.className.includes("twoRowExtraRow lost")) {
|
||||
maps_won.push(score_row.innerText);
|
||||
|
@ -144,7 +148,7 @@ async function run(hltv_url, host, port) {
|
|||
response.end();
|
||||
})
|
||||
.catch(error => {
|
||||
response.write(error);
|
||||
response.write(String(error));
|
||||
response.end();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue