fix: prevent potential errors by adding optional chaining to rewardProgram access in pos_order_patch

This commit is contained in:
Suherdy Yacob 2026-05-26 09:41:44 +07:00
parent a8f4095765
commit ca97bab9c4

View File

@ -57,7 +57,7 @@ patch(PosOrder.prototype, {
}
for (const program of programs) {
// Skip lines for the current program's discounts.
if (isDiscount && rewardProgram.id === program.id) {
if (isDiscount && rewardProgram?.id === program.id) {
continue;
}
for (const rule of program.rule_ids) {