Commit e8e4a7ec authored by Christian Eichler's avatar Christian Eichler
Browse files

server: Properly handle cubes without previous connections

parent 8154f020
Pipeline #32109 passed with stage
in 7 minutes and 33 seconds
......@@ -155,6 +155,11 @@ var endRangeMoment = moment.unix(endRange);
// Würfelinformationen
for (var cube in data['cube']) {
if(data.cube[cube].connection.length === 0) {
console.warn("Found empty cube, skipping...");
continue;
}
$('#cubes').append(
'<div class="cube">' +
'<div class="cubeid">' + data.cube[cube].id + ' Update ' + lastUpdate(data.cube[cube]) + '</div>' +
......
......@@ -8,6 +8,9 @@ function newestUpdateIdx(data) {
idx = i;
}
}
if(undefined === idx) {
console.error("newestUpdateIdx: Failed to find any index!\nStuff will break later on...");
}
return idx;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment