mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 21:45:47 +01:00
prevent crash if topic graph is clicked while not loaded
This commit is contained in:
@@ -293,7 +293,9 @@ define('admin/general/dashboard', ['semver'], function(semver) {
|
||||
graphs.topics = new Chart(topicsCtx).Doughnut([], {responsive: true});
|
||||
topicsCanvas.onclick = function(evt){
|
||||
var obj = graphs.topics.getSegmentsAtEvent(evt);
|
||||
window.open(RELATIVE_PATH + '/topic/' + obj[0].tid);
|
||||
if (obj && obj[0]) {
|
||||
window.open(RELATIVE_PATH + '/topic/' + obj[0].tid);
|
||||
}
|
||||
};
|
||||
|
||||
intervals.graphs = setInterval(updateTrafficGraph, 15000);
|
||||
|
||||
Reference in New Issue
Block a user