MMM-GoogleTasks icon indicating copy to clipboard operation
MMM-GoogleTasks copied to clipboard

getDom gets number of tasks before checking if any tasks exists - throws NULL error

Open ruff-hi opened this issue 3 years ago • 0 comments

You need to move the numTasks line to the 'else' part of if any tasks statement.

getDom: function() {
	var wrapper = document.createElement('div');
	wrapper.className = "container ";
	wrapper.className += this.config.tableClass;

	if (!this.tasks) {
		wrapper.innerHTML = (this.loaded) ? "EMPTY" : "LOADING";
		wrapper.className = this.config.tableClass + " dimmed";
		return wrapper;
	} else {
		var numTasks = Object.keys(this.tasks).length;
	}

ruff-hi avatar Jan 31 '22 12:01 ruff-hi