skip unkown cluster ids when opening the clusters

if someone opens a cluster manually it doesn't exits anymore in the cluster.
However the clusterIndex has still the same size.
Which makes the openClusters function fail.
This an easy workaround to get around this problem.
This commit is contained in:
Andreas Zweili 2018-07-26 21:38:25 +02:00
parent 52c09a7383
commit fa52ed2706
1 changed files with 5 additions and 0 deletions

View File

@ -92,7 +92,12 @@ Please be patient and don't refresh the page.</p>
function openClusters() {
var newClusters = [];
for (var i = 0; i < clusters.length; i++) {
try {
network.openCluster(clusters[i].id);
}
catch {
continue;
}
}
if (document.getElementById('stabilizeCheckbox').checked === true) {
network.stabilize();