fix bug when rpc reply error is null in json

fix bug when rpc reply error is null in json, result would not be
returned, even though no error happened. Bug originally introduced in
commit a8b9b97357fd678cebd68050a2bae48f90ab6679