From 34ea46fc9a776154fb4e904fb93401900c8901b7 Mon Sep 17 00:00:00 2001 From: TheClashFruit Date: Wed, 13 Dec 2023 18:24:39 +0100 Subject: [PATCH] fix: fix null error --- index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 8d553c7..44e2edb 100644 --- a/index.php +++ b/index.php @@ -31,7 +31,10 @@ $json = json_decode($res->body, true); - $twig->addGlobal('playerCount', count($json)); + if($json != null) { + $twig->addGlobal('playerCount', count($json)); + } + $twig->addGlobal('nations', $nations); $router->get('/', function() {