mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-11-16 14:15:04 -05:00
Add response check, fixes #252
This commit is contained in:
parent
d6afe77d4c
commit
029fa9bf31
@ -15,7 +15,8 @@ var github = (function(){
|
|||||||
, error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); }
|
, error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); }
|
||||||
, success: function(data) {
|
, success: function(data) {
|
||||||
var repos = [];
|
var repos = [];
|
||||||
for (var i = 0; i < data.repositories.length; i++){
|
if (!data || !data.repositories) { return; }
|
||||||
|
for (var i = 0; i < data.repositories.length; i++) {
|
||||||
if (options.skip_forks && data.repositories[i].fork) { continue; }
|
if (options.skip_forks && data.repositories[i].fork) { continue; }
|
||||||
repos.push(data.repositories[i]);
|
repos.push(data.repositories[i]);
|
||||||
}
|
}
|
||||||
@ -30,7 +31,7 @@ var github = (function(){
|
|||||||
if (options.count) { repos.splice(options.count); }
|
if (options.count) { repos.splice(options.count); }
|
||||||
render(options.target, repos);
|
render(options.target, repos);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user