flashkillapp / flashkill

Browser extension enriching the 99Damage league pages with usefull information.
MIT License
5 stars 2 forks source link

Can't create results table for every team #70

Open Lyannic opened 2 years ago

Lyannic commented 2 years ago

The results table for https://liga.99damage.de/leagues/teams/55410-onyx-talents can't be created. For me, the background script throws a console error Screenshot from 2021-10-28 11-55-49 It indicated that the error is in line

match.draftMaps.find(function(draftMap)

of

var getMatchTableItems = function getMatchTableItems(match, division) {
    var season = (0,
    _selectors__WEBPACK_IMPORTED_MODULE_5__.getSeason)(division.url);
    if (match.scores.length === 0) {
        return [_objectSpread(_objectSpread({}, match), {}, {
            division: division
        }, season && {
            season: season
        })];
    }
    return match.scores.map(function(score, index) {
        return _objectSpread(_objectSpread(_objectSpread({}, match), {}, {
            division: division,
            score1: score.score1,
            score2: score.score2
        }, season && {
            season: season
        }), {}, {
            map: match.draftMaps.find(function(draftMap) {
                return draftMap.id === match.draftMapvotingPicks[index];
            })
        });
    });
};
timonla commented 2 years ago

I guess this field is optional.

https://github.com/flashkillapp/flashkill/blob/5feaf28e1866c80fbf5e8dc1155de8d529e93005/src/model/Match.ts#L70