You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/01/10 16:02:06 UTC

[GitHub] jasonpet closed pull request #315: Guard Against Message of NoneType

jasonpet closed pull request #315: Guard Against Message of NoneType
URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/315
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 @@ def __encodeMessageIfNeeded(self, value):
             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:


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services