From f82c4c7f9c1a696b352e7812c454cb700ad096a2 Mon Sep 17 00:00:00 2001
From: Henning <leutz@pcsg.de>
Date: Thu, 27 Mar 2025 13:04:22 +0100
Subject: [PATCH] fix: prevent error when products is undefined in
 orderprocess.js

This commit includes a bug fix where an error would occur if products were undefined in the entity
OrderProcess. Now, it checks whether products is not undefined before checking its length. This
condition provides a more thorough and reliable check.
---
 bin/frontend/controls/OrderProcess.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/frontend/controls/OrderProcess.js b/bin/frontend/controls/OrderProcess.js
index 94f7963e..5c24c032 100644
--- a/bin/frontend/controls/OrderProcess.js
+++ b/bin/frontend/controls/OrderProcess.js
@@ -1684,7 +1684,7 @@ define('package/quiqqer/order/bin/frontend/controls/OrderProcess', [
                     const products = basket.products;
 
                     // if there are no products yet, merge without query
-                    if (!products.length) {
+                    if (!products || !products.length) {
                         GlobalBasket.setAttribute('mergeLocalStorage', 1);
                         GlobalBasket.load().then(function() {
                             window.location.reload();
-- 
GitLab