Просмотр исходного кода

Fix "Trying to access array offset on value of type null"

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/data/www/demo.enginegp.com/system/acp/sections/tarifs/index.php:42
#3 Whoops\Run:handleError in /var/www/enginegp/data/www/demo.enginegp.com/system/acp/sections/tarifs/index.php:42
#2 include in /var/www/enginegp/data/www/demo.enginegp.com/system/acp/engine/tarifs.php:32
#1 include in /var/www/enginegp/data/www/demo.enginegp.com/system/acp/distributor.php:63
#0 include in /var/www/enginegp/data/www/demo.enginegp.com/acp/index.php:50
Sergei Solovev 1 год назад
Родитель
Сommit
49abaa470a
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      system/acp/sections/tarifs/index.php

+ 5 - 1
system/acp/sections/tarifs/index.php

@@ -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>#' . $tarif['unit'] . ' ' . 'Локация отсутствует' . '</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>';