From b2d323870fbf07960a315dd9bc64aee140338c1f Mon Sep 17 00:00:00 2001
From: Pascal Neub <p.neub@adito.de>
Date: Wed, 19 May 2021 13:36:02 +0000
Subject: [PATCH] =?UTF-8?q?[Projekt:=20xRM-ContactManagement][TicketNr.:?=
 =?UTF-8?q?=201074059][Email=5Flib:=20Parameter=20Anzahl=20/=20Reihenfolge?=
 =?UTF-8?q?=20f=C3=BCr=20EmailWritingUtils.openNewMail()=20und=20EmailWrit?=
 =?UTF-8?q?ingUtils.sendReportAsMail()=20falsch.]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 process/Attribute_lib/process.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/process/Attribute_lib/process.js b/process/Attribute_lib/process.js
index 20c80caef6..319191882d 100644
--- a/process/Attribute_lib/process.js
+++ b/process/Attribute_lib/process.js
@@ -769,7 +769,7 @@ AttributeRelationUtils.validateAttributeCount = function (pRowId, pObjectType, p
         }, countObj);
     }
     
-    var possibleAttributes = AttributeUtil.getPossibleAttributes(pObjectType, undefined, pFilteredAttributeIds);
+    var possibleAttributes = AttributeUtil.getPossibleAttributes(pObjectType, undefined, pFilteredAttributeIds) || [];
     var minMaxCounts = [];
     
     if (possibleAttributes.length > 0)
@@ -794,8 +794,8 @@ AttributeRelationUtils.validateAttributeCount = function (pRowId, pObjectType, p
     // get all possible parent attributes
     var possibleParentAttributes = newSelect("distinct ATTRIBUTE_PARENT_ID")
                                     .from("AB_ATTRIBUTE")
-                                    .where("AB_ATTRIBUTE.AB_ATTRIBUTEID", possibleAttributes, SqlBuilder.IN())
-                                    .arrayColumn();
+                                    .whereIfSet("AB_ATTRIBUTE.AB_ATTRIBUTEID", possibleAttributes, SqlBuilder.IN())
+                                    .arrayColumn(true);
     // remove empty elements
     possibleParentAttributes = possibleParentAttributes.filter(function (el) { return el != null && el != ""; });
     
-- 
GitLab