From a311be9dd2bf02229963de0f494df840eaca4593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=A4del?= Date: Mon, 17 Jun 2019 18:42:57 +0200 Subject: [PATCH] fix undefined array index warning --- application/models/Dxcc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 99d02908..59a74464 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -68,6 +68,12 @@ class DXCC extends CI_Model { } // update stats + if (!isset($results[$row->COL_COUNTRY])) + $results[$row->COL_COUNTRY] = []; + + if (!isset($results[$row->COL_COUNTRY][$row->COL_BAND])) + $results[$row->COL_COUNTRY][$row->COL_BAND] = 0; + $results[$row->COL_COUNTRY][$row->COL_BAND] += $row->cnt; }