fix bug when error: null in json reply

fix bug when error: null in json reply
bug introduced in commit: a9669a983d74d4ff60cba56aafba6bc63773aad5