fix handling of rpc null

pull/2/head
fuwa 4 years ago
parent c5e54eade5
commit 09a9bc4ee8

@ -69,7 +69,7 @@ Future<dynamic> rpc(final String method, {final String field}) async {
return null;
} else {
final _body = await compute(jsonDecode, response.body);
final _result = _body['result'];
final _result = _body['result'] ?? const {};
final _field = field == null ? _result : _result[field];
return _field;