Skip to content

Commit

Permalink
check for undefined reminder values
Browse files Browse the repository at this point in the history
  • Loading branch information
Raimund Schlüßler committed Jul 7, 2015
1 parent 7c1bf1a commit 3583d04
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions controller/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 3583d04

Please sign in to comment.