Do not crash if graph data rendering tries to access already destroyed dom element

This commit is contained in:
Johannes Zellner
2025-05-27 14:34:13 +02:00
parent 6adf26f4d9
commit 83aaa9e8f0
+1 -1
View File
@@ -131,7 +131,7 @@ function fillGraph(element, contents, chartPropertyName, divisor, max, format, f
if (stepSize) options.scales.y.ticks.stepSize = stepSize;
if (graphs[chartPropertyName]) graphs[chartPropertyName].destroy();
graphs[chartPropertyName] = new Chart(element.getContext('2d'), { type: 'line', data: graphData, options: options });
if (element) graphs[chartPropertyName] = new Chart(element.getContext('2d'), { type: 'line', data: graphData, options: options });
}
async function refresh() {