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) {
|
'getGoodRandomImage': function(callback) {
|
||||||
this.api.getRandomImage(function(url, slug, hash) {
|
this.api.getRandomImage(function(url, slug, hash) {
|
||||||
this.api.getImageInfo(slug, function(imgData) {
|
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);
|
callback(url, imgData);
|
||||||
} else {
|
} else {
|
||||||
this.api.getGoodRandomImage(callback);
|
this.api.getGoodRandomImage(callback);
|
||||||
|
Loading…
Reference in New Issue
Block a user