Browse Source

Handle possibility there are no workers (#4074)

Fixes issue where an exception is raised if eg `celery graph workers` is invoked when there are no workers at all.
Derek Harland 7 years ago
parent
commit
cd89518cf2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      celery/bin/graph.py

+ 1 - 1
celery/bin/graph.py

@@ -161,7 +161,7 @@ class graph(Command):
             workers = args['nodes']
             threads = args.get('threads') or []
         except KeyError:
-            replies = self.app.control.inspect().stats()
+            replies = self.app.control.inspect().stats() or {}
             workers, threads = [], []
             for worker, reply in items(replies):
                 workers.append(worker)