Stop PHP notice when accessing invalid event ID
authorBradley Taylor <hello@brad-taylor.co.uk>
Mon, 29 Aug 2022 10:49:02 +0000 (11:49 +0100)
committerBradley Taylor <hello@brad-taylor.co.uk>
Mon, 29 Aug 2022 10:49:10 +0000 (11:49 +0100)
CRM/Event/Page/EventInfo.php

index 778549e3e58e6266d78e16d95fbc44a885a0efd5..92ffc131e1980e7eb30153b12b1b9d423e305108 100644 (file)
@@ -61,7 +61,7 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
     $values = ['event' => NULL];
     CRM_Event_BAO_Event::retrieve($params, $values['event']);
 
-    if (!$values['event']['is_active']) {
+    if (!$values['event'] || !$values['event']['is_active']) {
       CRM_Utils_System::setUFMessage(ts('The event you requested is currently unavailable (contact the site administrator for assistance).'));
       return CRM_Utils_System::permissionDenied();
     }