[Notice] Trying to get property of non-object

GET /about-us/news-and-events/diary-dates/ics/408/20180917T-20180917T

Line 716 in /var/www/vhosts/strcjmi.herts.sch.uk/public_html/event_calendar/code/Calendar.php

Source

707 			$id = str_replace("announcement-","",$id);
708 			$announcement = true;
709 		}
710 		else {			
711 			$announcement = false;
712 		}
713 		if(is_numeric($id) && $oid) {
714 			if(!$feed) { 
715 				$event = DataObject::get_by_id($announcement ? $this->data()->getDateTimeClass() : $this->data()->getEventClass(), $id);
716 				$FILENAME = $announcement ? preg_replace("/[^a-zA-Z0-9s]/", "", $event->Title) : $event->URLSegment;
717 			}
718 			else {
719 				$FILENAME = preg_replace("/[^a-zA-Z0-9s]/", "", urldecode($_REQUEST['title']));
720 			}
721 
722 			$FILENAME .= ".ics";

Trace

GET /about-us/news-and-events/diary-dates/ics/408/20180917T-20180917T

[User Error] Uncaught Error: Call to a member function AbsoluteLink() on boolean

GET /about-us/news-and-events/diary-dates/ics/408/20180917T-20180917T

Line 731 in /var/www/vhosts/strcjmi.herts.sch.uk/public_html/event_calendar/code/Calendar.php

Source

722 			$FILENAME .= ".ics";
723 			$HOST = $_SERVER['HTTP_HOST'];
724 			$TIMEZONE = Calendar::config()->timezone;
725 			$LANGUAGE = Calendar::config()->language;
726 			$CALSCALE = "GREGORIAN";
727 			$parts = explode('-',$oid);
728 			$START_TIMESTAMP = $parts[0];
729 			$END_TIMESTAMP = $parts[1];
730 			if(!$feed) {
731 				$URL = $announcement ? $event->Calendar()->AbsoluteLink() : $event->AbsoluteLink();
732 			}
733 			else {
734 				$URL = "";
735 			}
736 			$TITLE = $feed ? $_REQUEST['title'] : $event->Title;
737 			$this->getResponse()->addHeader('Cache-Control','private');

Trace