Merge pull request #1176 from pratik-joshi/CRM-13025
[civicrm-core.git] / CRM / Core / Permission.php
index 7ed36300112d33de07f543b90ed8ccc750c43cc8..52cc6f041a4b651017650957e751b60352cd28f5 100644 (file)
@@ -279,7 +279,11 @@ class CRM_Core_Permission {
     if (!$eventID) {
       return $permissionedEvents;
     }
-    return array_search($eventID, $permissionedEvents) === FALSE ? NULL : $eventID;
+    if (!empty($permissionedEvents)){
+      return array_search($eventID, $permissionedEvents) === FALSE ? NULL : $eventID;
+    } else {
+      return $eventID;
+    }
   }
 
   static function eventClause($type = CRM_Core_Permission::VIEW, $prefix = NULL) {