From 52ac36f2e631390e231d48e7eb03a1049975597c Mon Sep 17 00:00:00 2001
From: Henning Leutz <leutz@pcsg.de>
Date: Mon, 6 Sep 2021 12:03:05 +0200
Subject: [PATCH] fix: pcsg/kunden/froilein-adrett-template#106

---
 src/QUI/ERP/Discount/Discount.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/QUI/ERP/Discount/Discount.php b/src/QUI/ERP/Discount/Discount.php
index e737981..bfbaf77 100644
--- a/src/QUI/ERP/Discount/Discount.php
+++ b/src/QUI/ERP/Discount/Discount.php
@@ -387,9 +387,11 @@ public function canUsedWith(QUI\ERP\Products\Interfaces\ProductInterface $Produc
         }
 
         // article / product check
-        foreach ($articles as $articleId) {
-            if ((int)$Product->getId() === (int)$articleId) {
-                return true;
+        if (\is_array($articles)) {
+            foreach ($articles as $articleId) {
+                if ((int)$Product->getId() === (int)$articleId) {
+                    return true;
+                }
             }
         }
 
-- 
GitLab