Skip to content

TypeError: Cannot read properties of null (reading 'toString') when trying to read #452

Discussion options

You must be logged in to vote

Seems like the failing event has an alarm without the 'trigger' property set, which is invalid syntax according the ical standard.

  1. easy fix
    set var addAlerts = "no";

  2. option
    change helpers.gs

    GAS-ICS-Sync/Helpers.gs

    Lines 502 to 513 in 71bb0a6

    for (var valarm of valarms){
    var trigger = valarm.getFirstPropertyValue('trigger').toString();
    try{
    var alarmTime = new ICAL.Time.fromString(trigger);
    trigger = alarmTime.subtractDateTz(icalEvent.startDate).toString();
    }catch(e){}
    if (overrides.length < 5){ //Google supports max 5 reminder-overrides
    var timer = parseNotificationTime(trigger);
    if (0 <= timer && timer <= 40320)
    overrides.push({

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ChristianNewton
Comment options

Comment options

You must be logged in to vote
1 reply
@ChristianNewton
Comment options

Answer selected by ChristianNewton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants