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

TypeError: Cannot read property 'iterator' of null #179

Closed
fizzfaldt opened this issue Jan 18, 2021 · 3 comments
Closed

TypeError: Cannot read property 'iterator' of null #179

fizzfaldt opened this issue Jan 18, 2021 · 3 comments

Comments

@fizzfaldt
Copy link
Contributor

I get the following error/stack trace when trying to sync a company holiday/days off calendar:

Error	TypeError: Cannot read property 'iterator' of null
    at checkSkipEvent(Helpers:442:24)
    at createEvent(Helpers:251:27)
    at processEvent(Helpers:193:18)
    at [unknown function](Code:181:9)
    at startSync(Code:180:15)

(Probably not helpful but just in case, included screenshot of the above stack trace)
GCS-Stack-Trace

I have not used this particular ICS feed url with GAS-ICS-Sync before but I have used others successfully.
This particular ICS feed url works perfectly fine with Google Calendar directly (except of course Google calendar is terrible about updating which is why I'm using GAS-ICS-Sync)

I've verified I'm running the newest version:

var thisVersion = 5.5;

The ICS link is available (it's a public benefits calendar so original link is included), but the saved output ICS is at https://pastebin.com/u6nxqPTF

My settings (removed comments, and marked which booleans are not default settings)

var sourceCalendars = [
  ["https://benefits.vmware.com/?plugin=all-in-one-event-calendar&controller=ai1ec_exporter_controller&action=export_events&no_html=true&ai1ec_cat_ids=1870&lang=en", "VMwareCompanyHolidays"],
];

var howFrequent = 15;
var onlyFutureEvents = true; // NOT DEFAULT
var addEventsToCalendar = true;
var modifyExistingEvents = true;
var removeEventsFromCalendar = true;
var addAlerts = false; // NOT DEFAULT
var addOrganizerToTitle = false;
var descriptionAsTitles = true; // NOT DEFAULT
var addCalToTitle = false;
var addAttendees = false;
var defaultAllDayReminder = -1;

var addTasks = false;

var emailSummary = false;
var email = "REDACTED_BUT_SET_TO_SOMETHING@gmail.com"; // NOT DEFAULT
@derekantrican
Copy link
Owner

First off, this seems to only be related to using onlyFutureEvents = true so as a workaround you can try turning that off.

Second, it seems to be due to this event:

BEGIN:VEVENT
UID:ai1ec-59463@benefits.vmware.com
CATEGORIES;LANGUAGE=us:AMER\,APJ\,Argentina\,Armenia\,Australia\,Austria\,B
 elgium\,Brazil\,Bulgaria\,Canada\,Chile\,China\,Colombia\,Costa Rica\,Denma
 rk\,Egypt\,EMEA\,France\,Germany\,Hong Kong\,India\,Indonesia\,Ireland\,Isr
 ael\,Italy\,Japan\,Korea\,Malaysia\,Mexico\,Netherlands\,New Zealand\,Norwa
 y\,Philippines\,Poland\,Russia\,Saudi Arabia\,Singapore\,South Africa\,Spai
 n\,Sweden\,Switzerland\,Taiwan\,Thailand\,Turkey\,UAE\,United Kingdom\,Unit
 ed States
CONTACT:
DESCRIPTION:EPIC2 Year End Shutdown
DTSTART;VALUE=DATE:20201228
DTEND;VALUE=DATE:20201229
RDATE:20201228T000000Z
RDATE:20201229T000000Z
RDATE:20201230T000000Z
RDATE:20201231T000000Z
RDATE:20210101T000000Z
SEQUENCE:0
SUMMARY:EPIC2 Year End Shutdown
URL:https://benefits.vmware.com/event/epic2-year-end-shutdown/
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2//E
 N'>\\n<HTML>\\n<HEAD>\\n<TITLE></TITLE>\\n</HEAD>\\n<BODY><p>EPIC2 Year End
  Shutdown</p>\n</BODY></HTML>
END:VEVENT

This event has some RDATE values, but no indication of recurrence otherwise - yet icalEvent.isRecurring() is returning true. Likely an issue with ical.js. @jonas0b1011001 since you're working on recurring events, anything to weigh in?

@jonas0b1011001
Copy link
Collaborator

Try using Helpers.gs from this branch, should actually be fixed.

@fizzfaldt
Copy link
Contributor Author

fizzfaldt commented Jan 19, 2021

First off, this seems to only be related to using onlyFutureEvents = true so as a workaround you can try turning that off.

I can confirm that workaround does work (allows the ICS to load properly), however it's a problem cause my other ICS is HUGE and I don't want past events (and can't control past events separately for different ICS files).

Try using Helpers.gs from this branch, should actually be fixed.

Can confirm that Helpers.gs from the branch you linked works (and then I no longer need the workaround of onlyFutureEvents = true).

Do you want this issue closed, or wait for the issue to make it to main and/or release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants