Fixed error when name could not be found

This commit is contained in:
Selim Mustafaev 2022-04-19 15:23:03 +03:00
parent fc5ec6d0bd
commit 1de3d76a9f

View File

@ -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 {