From 7bac0d7ebe30ad12de8a54ad7e5b6e5609445ec6 Mon Sep 17 00:00:00 2001 From: frederik Date: Fri, 15 Nov 2024 19:19:53 +0100 Subject: [PATCH] fix: chart might not exist yet at initial page load --- scripts/overview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/overview.php b/scripts/overview.php index bd75b41..a88d2f6 100644 --- a/scripts/overview.php +++ b/scripts/overview.php @@ -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);