Fix crash in debug log

This commit is contained in:
Julien Duponchelle 2015-02-05 16:34:18 +01:00
parent 0abf2e82d6
commit 30f10a559e

View File

@ -43,7 +43,7 @@ class Response(aiohttp.web.Response):
log.debug("%s", request.json)
log.info("Response: %d %s", self.status, self.reason)
log.debug(dict(self.headers))
if hasattr(self, 'body'):
if hasattr(self, 'body') and self.body is not None:
log.debug(json.loads(self.body.decode('utf-8')))
return super().start(request)