Browse Source

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
Sergei Solovev 1 năm trước cách đây
mục cha
commit
5121c12fea
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  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>Локация отсутствует</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>';