From ca97bab9c4b1ec2e6d2bb0df5f1449a0ce7a93d7 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Tue, 26 May 2026 09:41:44 +0700 Subject: [PATCH] fix: prevent potential errors by adding optional chaining to rewardProgram access in pos_order_patch --- static/src/app/pos_order_patch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/src/app/pos_order_patch.js b/static/src/app/pos_order_patch.js index 5bfb8cb..7e0e3ac 100644 --- a/static/src/app/pos_order_patch.js +++ b/static/src/app/pos_order_patch.js @@ -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) {