From 000ffd1faea7c1a80adb743a8137d3f831711c9e Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 12 Nov 2022 18:12:42 +0100 Subject: [PATCH] Scheduler: Handle weird cases when the task we're iterating on is null --- kernel/src/thread/Scheduler.cpp | 1 + 1 file changed, 1 insertion(+) 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;