From 017e245357d89e809246fa5083476f320f515267 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Patrick=20M=C3=BCller?= <p.mueller@pcsg.de>
Date: Thu, 28 Dec 2023 08:10:14 +0100
Subject: [PATCH] fix: consider case in onQuiqqerOrderBasketRemovePos where
 article does not exist

---
 src/QUI/ERP/Coupons/Events.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/QUI/ERP/Coupons/Events.php b/src/QUI/ERP/Coupons/Events.php
index 8c6495d..7f4f137 100644
--- a/src/QUI/ERP/Coupons/Events.php
+++ b/src/QUI/ERP/Coupons/Events.php
@@ -159,6 +159,11 @@ public static function onQuiqqerOrderBasketRemovePos(
 
 
         $Article = $Order->getArticles()->getArticle($pos);
+
+        if (!$Article) {
+            return;
+        }
+
         $customData = $Article->getCustomData();
         $orderCoupons = $Order->getDataEntry('quiqqer-coupons');
 
-- 
GitLab