Scheduler: Handle weird cases when the task we're iterating on is null

This commit is contained in:
apio 2022-11-12 18:12:42 +01:00
parent 37bb3273ce
commit 000ffd1fae

View File

@ -40,6 +40,7 @@ template <typename Callback> void sched_for_each_task(Callback callback)
Task* task = base_task; Task* task = base_task;
if (!task) return; if (!task) return;
do { do {
if (!task) break;
bool will_continue = callback(task); bool will_continue = callback(task);
if (!will_continue) break; if (!will_continue) break;
task = task->next_task; task = task->next_task;