fixed gild response error
This commit is contained in:
parent
701aba56d3
commit
0c362345c7
1 changed files with 2 additions and 3 deletions
5
app.js
5
app.js
|
@ -362,11 +362,10 @@ const gildThing = (thingFullId, callback) => {
|
|||
try {
|
||||
response = JSON.parse(body);
|
||||
} catch (e) {
|
||||
return callback(e, null);
|
||||
//return callback(e, null);
|
||||
}
|
||||
|
||||
if (response.json.ratelimit > 0 ||
|
||||
response.json.errors.length > 0) {
|
||||
if (response && (response.json.ratelimit > 0 || response.json.errors.length > 0)) {
|
||||
return callback(new Error('Rate limited.'), null);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue