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") {
|
if (score_row.className === "livescore twoRowExtraRow") {
|
||||||
var score_el = score_row.querySelector("[data-livescore-current-map-score='']");
|
var score_el = score_row.querySelector("[data-livescore-current-map-score='']");
|
||||||
var maps_won_el = score_row.querySelector("[data-livescore-maps-won-for='']");
|
var maps_won_el = score_row.querySelector("[data-livescore-maps-won-for='']");
|
||||||
rounds_won.push(score_el.innerText);
|
if (score_el !== null) {
|
||||||
maps_won.push(maps_won_el.innerText);
|
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") ||
|
} else if (score_row.className.includes("twoRowExtraRow won") ||
|
||||||
score_row.className.includes("twoRowExtraRow lost")) {
|
score_row.className.includes("twoRowExtraRow lost")) {
|
||||||
maps_won.push(score_row.innerText);
|
maps_won.push(score_row.innerText);
|
||||||
|
@ -144,7 +148,7 @@ async function run(hltv_url, host, port) {
|
||||||
response.end();
|
response.end();
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
response.write(error);
|
response.write(String(error));
|
||||||
response.end();
|
response.end();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue