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
This commit is contained in:
Sergei Solovev 2023-12-24 11:42:48 +03:00
parent 276ec7f3eb
commit 5121c12fea

View file

@ -39,7 +39,11 @@ else {
$list .= '<tr>';
$list .= '<td>' . $tarif['id'] . '</td>';
$list .= '<td><a href="' . $cfg['http'] . 'acp/tarifs/id/' . $tarif['id'] . '">' . $tarif['name'] . '</a></td>';
$list .= '<td>#' . $tarif['unit'] . ' ' . $unit['name'] . '</td>';
if ($unit) {
$list .= '<td>#' . $tarif['unit'] . ' ' . $unit['name'] . '</td>';
} else {
$list .= '<td>Локация отсутствует</td>';
}
$list .= '<td>' . $tarif['slots_min'] . '-' . $tarif['slots_max'] . '</td>';
$list .= '<td>' . $tarif['port_min'] . '-' . $tarif['port_max'] . '</td>';
$list .= '<td>' . strtoupper($tarif['game']) . '</td>';