mirror of
https://github.com/LBRYFoundation/lbry-social-tipbot.git
synced 2025-08-23 17:47:28 +00:00
fix crash on 500 error in getMessageAuthor
This commit is contained in:
parent
68494c66b7
commit
adc253045b
1 changed files with 5 additions and 0 deletions
5
app.js
5
app.js
|
@ -533,6 +533,11 @@ const getMessageAuthor = (thingId, accessToken, callback) => {
|
||||||
return callback(e, null);
|
return callback(e, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// possible 500 error
|
||||||
|
if (!response || !response.data || !response.data.children) {
|
||||||
|
return callback(new Error('Could not retrieve the message author info.'), null);
|
||||||
|
}
|
||||||
|
|
||||||
return callback(null, (response.data.children.length > 0) ? response.data.children[0].data.author : null);
|
return callback(null, (response.data.children.length > 0) ? response.data.children[0].data.author : null);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue