Clear table only if taskList is not null