Make sure there is a task before continuing