From 06f907bade15c8af10d26b7fd8c7036c48ae699d Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Sun, 22 Jan 2023 09:01:33 -0500 Subject: [PATCH] Minor changes for PHP8 --- api/thermostat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/thermostat.php b/api/thermostat.php index 43211ad..fc2c2eb 100644 --- a/api/thermostat.php +++ b/api/thermostat.php @@ -517,7 +517,7 @@ class thermostat extends cora\crud { // Get all the scores from the other thermostats while($other_thermostat = $result->fetch_assoc()) { - $other_thermostat['profile'] = json_decode($other_thermostat['profile'], true); + $other_thermostat['profile'] = $other_thermostat['profile'] === null ? null : json_decode($other_thermostat['profile'], true); // Only use profiles with at least a year of data // Only use profiles generated in the past year if(