forked from GitHub/dbot
fix crash when imgur shit innit
This commit is contained in:
parent
3ff165f323
commit
ef4ceac61e
@ -109,7 +109,7 @@ var imgur = function(dbot) {
|
||||
'getGoodRandomImage': function(callback) {
|
||||
this.api.getRandomImage(function(url, slug, hash) {
|
||||
this.api.getImageInfo(slug, function(imgData) {
|
||||
if(imgData.data && imgData.data.height > 500 && imgData.data.width > 500) {
|
||||
if(imgData && imgData.data && imgData.data.height > 500 && imgData.data.width > 500) {
|
||||
callback(url, imgData);
|
||||
} else {
|
||||
this.api.getGoodRandomImage(callback);
|
||||
|
Loading…
Reference in New Issue
Block a user