From 5b52a92d38886ace434423006fd269178b5e583e Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 21 Sep 2023 03:12:12 +0000 Subject: [PATCH] fix cpu usage bugs --- System/SystemUtils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/System/SystemUtils.php b/System/SystemUtils.php index 0286cad5a..fac3f9e60 100755 --- a/System/SystemUtils.php +++ b/System/SystemUtils.php @@ -113,7 +113,7 @@ final class SystemUtils if (\stristr(\PHP_OS, 'WIN') !== false) { $cpuUsage = null; \exec('wmic cpu get LoadPercentage', $cpuUsage); - $cpuUsage = $cpuUsage[1]; + $cpuUsage = (int) ($cpuUsage[1] ?? 0); } elseif (\stristr(\PHP_OS, 'LINUX') !== false) { $loadavg = \sys_getloadavg();