Browse Source

Lookup task only if list has items

Marc Gibbons 8 years ago
parent
commit
522ef610ea
1 changed files with 2 additions and 1 deletions
  1. 2 1
      celery/canvas.py

+ 2 - 1
celery/canvas.py

@@ -1337,7 +1337,8 @@ class chord(Signature):
                 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