3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 03:33:07 +01:00

stupid sexy trapdoor

This commit is contained in:
reality 2013-10-24 22:17:10 +00:00
parent a28ec17a6d
commit 956b947a4c

View File

@ -81,7 +81,8 @@ var lastfm = function(dbot) {
}, function(err, res, body) {
if(_.has(body, 'error') && body.error == 6) {
callback('no_user', null);
} else if(_.has(body, 'recenttracks') && !_.isUndefined(body.recenttracks.track[0])) {
} else if(_.has(body, 'recenttracks') && _.has(body.recenttracks, 'track')
&& !_.isUndefined(body.recenttracks.track[0])) {
callback(null, body.recenttracks.track[0]);
} else {
callback('no_listen', null);