CASH-2025: Add null check
This commit is contained in:
parent
2f6a3aa844
commit
f1c4e291c3
1 changed files with 4 additions and 1 deletions
|
|
@ -939,9 +939,12 @@ export default {
|
||||||
const windshieldString = "WINDSHIELD";
|
const windshieldString = "WINDSHIELD";
|
||||||
this.lineItems.glassParts.forEach((part, index) => {
|
this.lineItems.glassParts.forEach((part, index) => {
|
||||||
if (part.partType === windshieldString) {
|
if (part.partType === windshieldString) {
|
||||||
this.lineItems.glassParts[index] = this.alternateGlassPartsForOem.find(
|
let altPartToUse = this.alternateGlassPartsForOem.find(
|
||||||
(altPart) => altPart.partType === windshieldString
|
(altPart) => altPart.partType === windshieldString
|
||||||
);
|
);
|
||||||
|
if (altPartToUse) {
|
||||||
|
this.lineItems.glassParts[index] = altPartToUse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue