fix: chart might not exist yet at initial page load

This commit is contained in:
frederik
2024-11-15 19:19:53 +01:00
parent d93a4fdd83
commit 7bac0d7ebe
+1 -1
View File
@@ -388,7 +388,7 @@ function refreshTopTen() {
const xhttp = new XMLHttpRequest();
xhttp.onload = function() {
if(this.responseText.length > 0 && !this.responseText.includes("Database is busy") && !this.responseText.includes("No Detections") || previous_detection_identifier == undefined) {
document.getElementById("chart").src = "Charts/"+this.responseText+"?nocache="+Date.now();
if (document.getElementById("chart")) {document.getElementById("chart").src = "Charts/"+this.responseText+"?nocache="+Date.now();}
}
}
xhttp.open("GET", "overview.php?fetch_chart_string=true", true);