diff --git a/kernel/src/thread/Scheduler.cpp b/kernel/src/thread/Scheduler.cpp index 5bece786..ed73d08d 100644 --- a/kernel/src/thread/Scheduler.cpp +++ b/kernel/src/thread/Scheduler.cpp @@ -40,6 +40,7 @@ template void sched_for_each_task(Callback callback) Task* task = base_task; if (!task) return; do { + if (!task) break; bool will_continue = callback(task); if (!will_continue) break; task = task->next_task;