fix bug when error: null in json reply

Return result when receiving a reply where the key "error" is null, like
this one: {"result":"some result here","error":null,"id":1}. Without
this change, the result would not be returned even though no error
happened.