From 201db49dac4c8dc359c4ceea86d2a2dc4097142f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Huchet?= Date: Sat, 18 Aug 2018 04:18:50 +0200 Subject: [PATCH] fix #166 Fix #166 --- src/controllers/LogViewerController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controllers/LogViewerController.php b/src/controllers/LogViewerController.php index f4272c0..9dbeaf4 100644 --- a/src/controllers/LogViewerController.php +++ b/src/controllers/LogViewerController.php @@ -67,9 +67,11 @@ public function index() return $data; } - $firstLog = reset($data['logs']); - if (!$firstLog['context'] && !$firstLog['level']) { - $data['standardFormat'] = false; + if (is_array($data['logs'])) { + $firstLog = reset($data['logs']); + if (!$firstLog['context'] && !$firstLog['level']) { + $data['standardFormat'] = false; + } } return app('view')->make('laravel-log-viewer::log', $data);