1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-04 06:10:18 +00:00

fix: initialize graph data with empty array if null

This commit is contained in:
leokeba
2022-11-03 01:37:46 +01:00
parent d53fdb57a9
commit 48594de29a
3 changed files with 219 additions and 218 deletions

3
data/js/controls.js vendored
View File

@ -176,7 +176,8 @@ function restoreGraphData(id) {
var savedData = localStorage.getItem("espuigraphs", graphData);
if (savedData != null) {
savedData = JSON.parse(savedData);
return savedData[id];
let idData = savedData[id];
return Array.isArray(idData) ? idData : [];
}
return [];
}