From 5ad27dd929157bead205d660c0bbd0570e02c9f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Mon, 11 Jul 2016 17:57:37 +0300 Subject: [PATCH] response data bug fix --- opt/ahenk/base/messaging/Messaging.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/opt/ahenk/base/messaging/Messaging.py b/opt/ahenk/base/messaging/Messaging.py index 4e8ccc4..9fc57e1 100644 --- a/opt/ahenk/base/messaging/Messaging.py +++ b/opt/ahenk/base/messaging/Messaging.py @@ -34,7 +34,10 @@ class Messaging(object): data['taskId'] = response.get_id() data['responseCode'] = response.get_code() data['responseMessage'] = response.get_message() - data['responseData'] = json.loads(str(response.get_data())) + response_data = None + if data['responseData'] is not None: + response_data = json.loads(str(response.get_data())) + data['responseData'] = response_data data['contentType'] = response.get_content_type() data['timestamp'] = response.get_timestamp() @@ -49,7 +52,12 @@ class Messaging(object): data['commandExecutionId'] = response.get_execution_id() data['responseCode'] = response.get_code() data['responseMessage'] = response.get_message() - data['responseData'] = response.get_data() + + response_data = None + if data['responseData'] is not None: + response_data = json.loads(str(response.get_data())) + + data['responseData'] = response_data data['contentType'] = response.get_content_type() data['timestamp'] = response.get_timestamp()