From 3d35f47ac9d7b9a58de78668239c6c0af26064c7 Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 13 Jan 2024 04:01:47 +0200 Subject: [PATCH] fix condition --- src/Controller/MainController.php | 2 +- src/Controller/ServerController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 714daae..8eb0ef0 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -103,7 +103,7 @@ class MainController extends AbstractController 'online' => $server->getOnline(), 'info' => $info, 'status' => $status, - 'connections' => is_null($info['Players']) || $info['Players'] < 0 || is_null($info['Bots']) || $info['Bots'] < 0 + 'connections' => empty($info['Players']) || $info['Players'] < 0 || empty($info['Bots']) || $info['Bots'] < 0 ? 0 : (int) $info['Players'] - (int) $info['Bots'] ]; diff --git a/src/Controller/ServerController.php b/src/Controller/ServerController.php index 1ec526d..18f272a 100644 --- a/src/Controller/ServerController.php +++ b/src/Controller/ServerController.php @@ -177,7 +177,7 @@ class ServerController extends AbstractController 'online' => $online, 'players' => $players, 'status' => $status, - 'connections' => is_null($info['Players']) || $info['Players'] < 0 || is_null($info['Bots']) || $info['Bots'] < 0 + 'connections' => empty($info['Players']) || $info['Players'] < 0 || empty($info['Bots']) || $info['Bots'] < 0 ? 0 : (int) $info['Players'] - (int) $info['Bots'] ]