| @@ -23,8 +23,14 @@ | ||
| 23 | 23 | 'message' => __('Calendar Event not found', 'fluent-booking') |
| 24 | 24 | ]); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | + if (!$calendarEvent->calendar) { | |
| 28 | + return $this->sendError([ | |
| 29 | + 'message' => __('Calendar not found', 'fluent-booking') | |
| 30 | + ]); | |
| 31 | + } | |
| 32 | + | |
| 27 | 33 | $calendarEvent->author_profile = $calendarEvent->getAuthorProfile(); |
| 28 | 34 | |
| 29 | 35 | $calendarEvent->calendar->author_profile = $calendarEvent->calendar->getAuthorProfile(); |
| 30 | 36 | |