fixed gild response error

This commit is contained in:
Akinwale Ariwodola 2017-09-24 09:13:36 +01:00
parent 701aba56d3
commit 0c362345c7

5
app.js
View file

@ -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);
}