Scheduler: Handle weird cases when the task we're iterating on is null
This commit is contained in:
parent
37bb3273ce
commit
000ffd1fae
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user