Support » Plugin: Simple Calendar - Google Calendar Plugin » Trying to get property of non-object

  • Resolved jjk697

    (@jjk697)


    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://wordpress.org/plugins/google-calendar-events/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Nick Young

    (@nickyoung87)

    Thanks for bringing this to our attention. There is a fix in place for this already for the next version.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Trying to get property of non-object’ is closed to new replies.