Trying to get property of non-object
-
I think this is a minor bug report…
My calendar is often not loaded with a lot of events.
When no events appear in my list view range, I get the error:Notice: Trying to get property of non-object in /home4/hrpta/public_html/wp/wp-content/plugins/google-calendar-events/includes/calendars/views/default-calendar-list.php on line 340
Notice: Trying to get property of non-object in /home4/hrpta/public_html/wp/wp-content/plugins/google-calendar-events/includes/calendars/views/default-calendar-list.php on line 343
The lines of code are:
$this->first_event = $first_event[0]->start;
and
$this->last_event = $last_event[0]->start;
Adding an empty check clears the error:
if (!empty($last_event)) $this->first_event = $first_event[0]->start;
and
if (!empty($last_event)) $this->last_event = $last_event[0]->start;
https://www.ads-software.com/plugins/google-calendar-events/
- The topic ‘Trying to get property of non-object’ is closed to new replies.