fix bug when error: null in json reply

fix bug when error: null in json reply, the result would not be returned