Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error on some ICS files from Google calendar #147

Closed
munkex opened this issue Jun 27, 2017 · 1 comment
Closed

Fatal error on some ICS files from Google calendar #147

munkex opened this issue Jun 27, 2017 · 1 comment

Comments

@munkex
Copy link

munkex commented Jun 27, 2017

Hello,

We are getting the following error on some Google calendar ics files when trying to run them through your parser:

Fatal error: Call to a member function getTimestamp() on a non-object in /home/openconnect/domains/sp.openconnect.dk/public_html/partners/screenpublisher/class.calendar.ical.php on line 661

I fixed it by adding the following: (Not sure if this is a proper fix for it)
I changed the following function
from:

public function iCalDateToUnixTimestamp($icalDate, $forceTimeZone = false, $forceUtc = false)
{
    $dateTime = $this->iCalDateToDateTime($icalDate, $forceTimeZone, $forceUtc);
    return $dateTime->getTimestamp();
}

to:

public function iCalDateToUnixTimestamp($icalDate, $forceTimeZone = false, $forceUtc = false)
{
    $dateTime = $this->iCalDateToDateTime($icalDate, $forceTimeZone, $forceUtc);

    if (is_object($dateTime)) {
        return $dateTime->getTimestamp();
    }
}
@u01jmg3 u01jmg3 self-assigned this Jun 27, 2017
@u01jmg3 u01jmg3 changed the title fatal error on some ics files from google calendar Fatal error on some ICS files from Google calendar Jun 27, 2017
@u01jmg3
Copy link
Owner

u01jmg3 commented Jun 27, 2017

Thank you for reporting this bug - a fix will be committed in the next few days

@u01jmg3 u01jmg3 added this to the v2.x.x milestone Jun 27, 2017
@u01jmg3 u01jmg3 removed their assignment Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants