From 3583d04c3037961caaf5bac51cb367e6aa5da8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Tue, 7 Jul 2015 22:00:14 +0200 Subject: [PATCH] check for undefined reminder values --- controller/helper.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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;