From 0da2e91a812f57a0dfe431aa42ead1630201ab26 Mon Sep 17 00:00:00 2001 From: Giuseppe Occhipinti Date: Mon, 23 Mar 2015 14:37:29 +0000 Subject: [PATCH] Fix exception when no log file exists --- src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php index f02828f..83c9efd 100644 --- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php +++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php @@ -50,6 +50,9 @@ public static function all() if (!self::$file) { $log_file = self::getFiles(); + if(!count($log_file)) { + return []; + } self::$file = $log_file[0]; }