This is an automated email from the ASF dual-hosted git repository.

japetrsn pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-kafka.git


The following commit(s) were added to refs/heads/master by this push:
     new a0428e6  Guard Against Message of NoneType (#315)
a0428e6 is described below

commit a0428e65011c61c73546d250ce3123dbac946ff6
Author: James Dubee <[email protected]>
AuthorDate: Thu Jan 10 11:02:03 2019 -0500

    Guard Against Message of NoneType (#315)
---
 provider/consumer.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/provider/consumer.py b/provider/consumer.py
index 865c209..84e1e2d 100644
--- a/provider/consumer.py
+++ b/provider/consumer.py
@@ -479,6 +479,9 @@ class ConsumerProcess (Process):
             except UnicodeDecodeError:
                 logging.warn('[{}] Value contains non-unicode bytes. Replacing 
invalid bytes.'.format(self.trigger))
                 value = unicode(value, errors='replace').encode('utf-8')
+        except AttributeError:
+           logging.warn('[{}] Cannot decode a NoneType message 
value'.format(self.trigger))
+           return value
 
         if self.encodeValueAsJSON:
             try:

Reply via email to