From b11bebf48927bf0ecd724f8e522023d088569534 Mon Sep 17 00:00:00 2001 From: Creeperman007 Date: Sun, 7 Jun 2020 18:35:20 +0200 Subject: [PATCH] Contets returning NULL When there is no active contest, function would try to access null type --- active.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/active.php b/active.php index d7e7782..16fdae3 100644 --- a/active.php +++ b/active.php @@ -2,7 +2,11 @@ function GetActiveId($bot) { $res = $bot->contestsList(); + + if (is_null($res)) + return false; + $contestId = $res["active"]["_id"]; - + return $contestId; }