From 5121c12feac6afeafba2cacf0021ed7aace39665 Mon Sep 17 00:00:00 2001 From: Sergei Solovev Date: Sun, 24 Dec 2023 11:42:48 +0300 Subject: [PATCH] Fixed a bug when a tariff was created and there is no location Whoops\Exception\ErrorException thrown with message "Trying to access array offset on value of type null" Stacktrace: #4 Whoops\Exception\ErrorException in /var/www/enginegp/system/acp/sections/tarifs/index.php:42 #3 Whoops\Run:handleError in /var/www/enginegp/system/acp/sections/tarifs/index.php:42 #2 include in /var/www/enginegp/system/acp/engine/tarifs.php:32 #1 include in /var/www/enginegp/system/acp/distributor.php:64 #0 include in /var/www/enginegp/acp/index.php:47 --- system/acp/sections/tarifs/index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/acp/sections/tarifs/index.php b/system/acp/sections/tarifs/index.php index f83359c..76614d6 100644 --- a/system/acp/sections/tarifs/index.php +++ b/system/acp/sections/tarifs/index.php @@ -39,7 +39,11 @@ else { $list .= ''; $list .= '' . $tarif['id'] . ''; $list .= '' . $tarif['name'] . ''; - $list .= '#' . $tarif['unit'] . ' ' . $unit['name'] . ''; + if ($unit) { + $list .= '#' . $tarif['unit'] . ' ' . $unit['name'] . ''; + } else { + $list .= 'Локация отсутствует'; + } $list .= '' . $tarif['slots_min'] . '-' . $tarif['slots_max'] . ''; $list .= '' . $tarif['port_min'] . '-' . $tarif['port_max'] . ''; $list .= '' . strtoupper($tarif['game']) . '';