Return dummy driver code in case qualifying data is not available

This commit is contained in:
Jan Philipp Timme 2017-12-30 18:14:51 +01:00
parent a81522790e
commit 18566d9bc2

View File

@ -381,7 +381,9 @@ function createLineGraph(containerId, raceData){
function getDriverCodeFromPosAndLap(raceData, lapNr, pos){
var driverCode = "";
if(lapNr == 0){
driverCode = getDriverCodeById(raceData, raceData.qualifying[pos - 1].driverId);
var qualifying = raceData.qualifying[pos - 1];
if(qualifying === undefined) return "XXX"; // TODO: Do a real fix
driverCode = getDriverCodeById(raceData, qualifying.driverId);
}else if(lapNr == raceData.lapTimes.size){
var resultPos = raceData.results[pos -1].position;
var resultLaps = raceData.results[pos -1].laps;