Cleanup failure handling around rust_new_task_in_sched - closes #2668

This commit is contained in:
Ben Blum 2012-06-28 19:01:55 -04:00
parent d91e310982
commit 6fc730baf6
5 changed files with 9 additions and 3 deletions

View file

@ -630,7 +630,8 @@ extern "C" CDECL rust_task*
rust_new_task_in_sched(rust_sched_id id) {
rust_task *task = rust_get_current_task();
rust_scheduler *sched = task->kernel->get_scheduler_by_id(id);
// FIXME (#2668): What if we didn't get the scheduler?
if (sched == NULL)
return NULL;
return new_task_common(sched, task);
}