From fbce7089a80b2c78e158ef2fe2f2fac561f134dd Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Mon, 7 Mar 2022 22:34:04 -0300 Subject: [PATCH] FIX: non array rows --- app/Service/Informe/Informe.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Service/Informe/Informe.php b/app/Service/Informe/Informe.php index ea9ecca..96af23c 100644 --- a/app/Service/Informe/Informe.php +++ b/app/Service/Informe/Informe.php @@ -16,11 +16,17 @@ class Informe { $maxCols = 0; foreach ($data as $row) { + if (!is_array($row)) { + continue; + } if (count($row) > $maxCols) { $maxCols = count($row); } } foreach ($data as &$row) { + if (!is_array($row)) { + $row = [$row]; + } if (count($row) < $maxCols) { $row = array_merge($row, array_fill(0, $maxCols - count($row), '')); }