From c9cee1ab54f2787fd9e9dd4b452d8d98aaf8862d Mon Sep 17 00:00:00 2001
From: Johannes Hoermann <j.hoermann@adito.de>
Date: Thu, 24 Oct 2019 15:59:53 +0200
Subject: [PATCH] fix state process appointment_entitiy - partstatactiongroup

---
 .../partstatactiongroup/stateProcess.js         | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/entity/Appointment_entity/entityfields/partstatactiongroup/stateProcess.js b/entity/Appointment_entity/entityfields/partstatactiongroup/stateProcess.js
index 86a064a2ea..7054b6c098 100644
--- a/entity/Appointment_entity/entityfields/partstatactiongroup/stateProcess.js
+++ b/entity/Appointment_entity/entityfields/partstatactiongroup/stateProcess.js
@@ -8,13 +8,20 @@ if(vars.getString("$param.Entry_param"))
 {
     var event = JSON.parse(vars.getString("$param.Entry_param"));
     
-    var ownerCn = event[calendars.USER2]["cn"];
-    var currentUserTitle = vars.getString("$sys.user");
-    
-    if(!(event[calendars.ORGANIZER] == currentUserTitle) && currentUserTitle == ownerCn)
-        result.object(neon.COMPONENTSTATE_AUTO);
+    if (event[calendars.USER2])
+    {
+        var ownerCn = event[calendars.USER2]["cn"];
+        var currentUserTitle = vars.getString("$sys.user");
+
+        if(!(event[calendars.ORGANIZER] == currentUserTitle) && currentUserTitle == ownerCn)
+            result.object(neon.COMPONENTSTATE_AUTO);
+        else
+            result.object(neon.COMPONENTSTATE_INVISIBLE);
+    }
     else
+    {
         result.object(neon.COMPONENTSTATE_INVISIBLE);
+    }
 }
 else
 {
-- 
GitLab