diff --git a/controller/helper.php b/controller/helper.php index cb1fc367..d5b7c1a8 100644 --- a/controller/helper.php +++ b/controller/helper.php @@ -85,9 +85,17 @@ public static function arrayForJSON($id, $vtodo, $user_timezone, $calendarId){ $reminder = $vtodo->VALARM; if($reminder) { try { - - $reminderType = $reminder->TRIGGER['VALUE']->getValue(); - $reminderAction = $reminder->ACTION->getValue(); + + if ($reminder->TRIGGER['VALUE']){ + $reminderType = $reminder->TRIGGER['VALUE']->getValue(); + } else { + throw new \Exception('Reminder type not specified.'); + } + if ($reminder->ACTION) { + $reminderAction = $reminder->ACTION->getValue(); + } else { + throw new \Exception('Reminder action not specified.'); + } $reminderDate = null; $reminderDuration = null;