Skip to content

Commit

Permalink
Lookup task only if list has items
Browse files Browse the repository at this point in the history
  • Loading branch information
marcgibbons authored and georgepsarakis committed Mar 26, 2017
1 parent 0ad41a0 commit 522ef61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion celery/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,8 @@ def _get_app(self, body=None):
tasks = self.tasks.tasks # is a group
except AttributeError:
tasks = self.tasks
app = tasks[0]._app
if len(tasks):
app = tasks[0]._app
if app is None and body is not None:
app = body._app
return app if app is not None else current_app
Expand Down

0 comments on commit 522ef61

Please sign in to comment.