FormatGoogleCalendar icon indicating copy to clipboard operation
FormatGoogleCalendar copied to clipboard

Uncaught TypeError: can't access property "firstChild", pastElem is null

Open ioannis-koukotzilas opened this issue 3 years ago • 0 comments

Hi and thanks for this amazing plugin.

I get this issue from the console:

Uncaught TypeError: can't access property "firstChild", pastElem is null
    renderList https://.../js/format-google-calendar.js:152
    onload https://.../js/format-google-calendar.js:182

I think the problem belongs to this part:

if (pastElem.firstChild) {
	pastElem.insertAdjacentHTML('beforebegin', settings.pastHeading);
}

and this:

//Get JSON, parse it, transform into list items and append it to past or upcoming events list
var request = new XMLHttpRequest();
request.open('GET', finalURL, true);

request.onload = function () {
	if (request.status >= 200 && request.status < 400) {
		var data = JSON.parse(request.responseText);
		renderList(data, settings);
	} else {
		console.error(err);
	}
};

Any help?

Thank you.

ioannis-koukotzilas avatar Mar 18 '21 19:03 ioannis-koukotzilas