Skip to content

Commit

Permalink
Bela_scheduleAuxiliaryTask: handle nullptr gracefully. Closes #730
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliomoro committed Nov 22, 2024
1 parent 45df829 commit e9269c3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/AuxiliaryTasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ AuxiliaryTask Bela_createAuxiliaryTask(void (*functionToCall)(void* args), int p
int Bela_scheduleAuxiliaryTask(AuxiliaryTask task)
{
InternalAuxiliaryTask *taskToSchedule = (InternalAuxiliaryTask *)task;
if(!task)
{
fprintf(stderr, "Bela_scheduleAuxiliaryTask(): invalid or uninitialised task\n");
return -1;
}
return taskToSchedule->task.schedule(false);
}

Expand Down

0 comments on commit e9269c3

Please sign in to comment.