diff --git a/app/Console/Commands/TestPao.php b/app/Console/Commands/TestPao.php index 40ce4c04..8158092d 100644 --- a/app/Console/Commands/TestPao.php +++ b/app/Console/Commands/TestPao.php @@ -98,9 +98,13 @@ class TestPao extends Command foreach ($articles as $article) { try { - $strarticolo = json_encode($article, JSON_PRETTY_PRINT); - echo $strarticolo; - $log .= $strarticolo; + if (is_array($article)) { + $strarticolo = json_encode($article, JSON_PRETTY_PRINT); + if ($strarticolo !== false) { + echo $strarticolo; + $log .= $strarticolo; + } + } $mostra = false; if ($mostra_solo_qta_negative) {