Fixed null tasks javascript error