Add another quick fix to avoid accessing undefined values
This commit is contained in:
parent
18566d9bc2
commit
d360d6c637
|
@ -102,7 +102,9 @@ function getDriverCodeAndPositionArray(raceData, lapNumber){
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDriverCodeById(raceData, driverId){
|
function getDriverCodeById(raceData, driverId){
|
||||||
return raceData.drivers.filter(driv => driv.driverId == driverId)[0].code;
|
var driverData = raceData.drivers.filter(driv => driv.driverId == driverId)[0];
|
||||||
|
if(driverData === undefined) return "XXX"; // TODO: Do a real fix instead of this quick fix
|
||||||
|
return driverData.code;
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeDuplicates(result,obj){
|
function removeDuplicates(result,obj){
|
||||||
|
|
Loading…
Reference in New Issue