diff --git a/src/controllers/dashboard/scheduledtasks/scheduledtasks.js b/src/controllers/dashboard/scheduledtasks/scheduledtasks.js index 359295d4617..db5f9255beb 100644 --- a/src/controllers/dashboard/scheduledtasks/scheduledtasks.js +++ b/src/controllers/dashboard/scheduledtasks/scheduledtasks.js @@ -132,8 +132,11 @@ function updateTaskButton(elem, state) { export default function(view) { function updateTasks(tasks) { for (const task of tasks) { - view.querySelector('#taskProgress' + task.Id).innerHTML = getTaskProgressHtml(task); - updateTaskButton(view.querySelector('#btnTask' + task.Id), task.State); + const taskProgress = view.querySelector(`#taskProgress${task.Id}`); + if (taskProgress) taskProgress.innerHTML = getTaskProgressHtml(task); + + const taskButton = view.querySelector(`#btnTask${task.Id}`); + if (taskButton) updateTaskButton(taskButton, task.State); } }