Do not crash if graph data rendering tries to access already destroyed dom element
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user