Skip to content

Commit 96418bb

Browse files
committed
Fixes #97: Return proper json in xmlToJson method, for none data arguments.
Previously our xmlToJson method returns ' ' on None argument, which is not proper json data. We should return '[]' for None data, instead ' '. This commit change the default value of resultant json data.
1 parent e77e7c6 commit 96418bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

loklak.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def status(self):
7474

7575
def xmlToJson(self, xmlData = None):
7676
"""Convert XML to JSON as the service."""
77-
jsonData = ''
77+
jsonData = '[]'
7878
if xmlData:
7979
jsonData = dumps(bf.data(et.fromstring(xmlData)))
8080
return jsonData

0 commit comments

Comments
 (0)