diff --git a/locust/contrib/fasthttp.py b/locust/contrib/fasthttp.py index d89a49ae27..e7ff761003 100644 --- a/locust/contrib/fasthttp.py +++ b/locust/contrib/fasthttp.py @@ -254,7 +254,10 @@ def text(self): # A TypeError can be raised if encoding is None # # Fallback to decode without specifying encoding - content = unicode(self.content, errors='replace') + if self.content is None: + content = None + else: + content = unicode(self.content, errors='replace') return content @property