Browse Source

Better handling of badly formated messages.

Leo Dirac 13 years ago
parent
commit
94d067555d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      celery/worker/consumer.py

+ 1 - 1
celery/worker/consumer.py

@@ -391,7 +391,7 @@ class Consumer(object):
                     "Couldn't ack %r: body:%r reason:%r" % (
                         message.delivery_tag, safe_repr(body), exc))
 
-        if not body.get("task"):
+        if not isinstance(body,dict) or not body.get("task"):
             warnings.warn(RuntimeWarning(
                 "Received and deleted unknown message. Wrong destination?!? \
                 the full contents of the message body was: %s" % (