mirror of https://github.com/status-im/web3.js.git
check request.status in httpsync.js to prevent throwing errors when undefined
This commit is contained in:
parent
ad8112c05a
commit
af7c26b163
|
@ -37,8 +37,10 @@ HttpSyncProvider.prototype.send = function (payload) {
|
||||||
request.open('POST', this.host, false);
|
request.open('POST', this.host, false);
|
||||||
request.send(JSON.stringify(payload));
|
request.send(JSON.stringify(payload));
|
||||||
|
|
||||||
// check request.status
|
|
||||||
var result = request.responseText;
|
var result = request.responseText;
|
||||||
|
// check request.status
|
||||||
|
if(request.status !== 200)
|
||||||
|
return;
|
||||||
return JSON.parse(result);
|
return JSON.parse(result);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue