diff --git a/routes/vehicles.js b/routes/vehicles.js index 6bffa47..c4e7ff8 100644 --- a/routes/vehicles.js +++ b/routes/vehicles.js @@ -75,7 +75,7 @@ router.post('/check', async (req, res) => { } else if(autocod.status == 'rejected') { vehicle = vin01.value; Object.assign(vehicle.debugInfo, autocod.reason.debugInfo); - if(!vehicle.brand.name.normalized) { + if(!vehicle.brand?.name?.normalized) { throw autocod.reason; } } else {