Added nullchecking for CeleryTask.