Twitter follow: verify that data is not undefined

This commit is contained in:
Thaddee Tyl 2016-02-22 19:44:29 +01:00
parent d23eb63da1
commit 5e4c711813

View File

@ -4523,7 +4523,7 @@ cache(function(data, match, sendBadge, request) {
// The data is formatted as an array.
var data = JSON.parse(buffer)[0];
// data.followers_count could be zero… don't just check if falsey.
if (data.followers_count != null){
if (data !== undefined && data.followers_count != null){
badgeData.text[1] = metric(data.followers_count);
}
} catch(e) {