3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 19:52:36 +01:00

Prevent profile break on no-stats bug

This commit is contained in:
Sam Nicholls 2013-01-26 18:11:28 +00:00
parent 00f04a01a9
commit fdd8ed7a6f

View File

@ -28,11 +28,17 @@ var pages = function(dbot) {
var chanData = dbot.api.stats.getChanStats(connection, channel, ["freq"]);
var chanFreq = [];
for(var i=0; i <= 6; i++){
for(var j=0; j <= 23; j++){
chanFreq.push(chanData.fields.freq.raw[i][j]);
if(chanData){
for(var i=0; i <= 6; i++){
for(var j=0; j <= 23; j++){
chanFreq.push(chanData.fields.freq.raw[i][j]);
}
}
}
else{
for (var i = 0; i < 168; i++) chanFreq[i] = 0;
}
var userData = { "active": [], "inactive": [], "offline": []};
var reply = dbot.api.stats.getChanUsersStats(connection, channel, [