diff --git a/src/lambda/handler-runner/python-runner/invoke.py b/src/lambda/handler-runner/python-runner/invoke.py index 9ecc23fcc..9fd0e4aa3 100644 --- a/src/lambda/handler-runner/python-runner/invoke.py +++ b/src/lambda/handler-runner/python-runner/invoke.py @@ -104,7 +104,7 @@ def log(self): '__offline_payload__': result } - if isinstance(result['body'], bytes): + if hasattr(result, 'body') and isinstance(result['body'], bytes): data['__offline_payload__']['body'] = base64.b64encode(result['body']).decode('utf-8') data['isBase64Encoded'] = True