From 1e67bb8011f2ee7e6a457b02bcc2cd53ab3d64f1 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 4 Mar 2021 15:50:35 +0200 Subject: [PATCH] Fixed error when checking missing log file [#2088] --- CHANGELOG.md | 4 +++- themes/grav/templates/partials/tools-logs.html.twig | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e3c6ce..c1251857 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ 1. [](#improved) * Force height of Flex pages admin to fit available space +1. [](#bugfix) + * Fixed error when checking missing log file [#2088](https://github.com/getgrav/grav-plugin-admin/issues/2088) # v1.10.6 ## 02/23/2021 @@ -13,7 +15,7 @@ * Flex pages admin better uses available space [#2075](https://github.com/getgrav/grav/issues/2075) 1. [](#bugfix) * Regression: Fixed enabling/disabling plugin or theme corrupting configuration - * Fixed unnecessary closing bracket cuasing JS error [#2079](https://github.com/getgrav/grav-plugin-admin/issues/2079) + * Fixed unnecessary closing bracket causing JS error [#2079](https://github.com/getgrav/grav-plugin-admin/issues/2079) * Fixed wrong language in Admin Tools [#2077](https://github.com/getgrav/grav-plugin-admin/issues/2077) # v1.10.5 diff --git a/themes/grav/templates/partials/tools-logs.html.twig b/themes/grav/templates/partials/tools-logs.html.twig index 1bef7325..56bee777 100644 --- a/themes/grav/templates/partials/tools-logs.html.twig +++ b/themes/grav/templates/partials/tools-logs.html.twig @@ -19,7 +19,7 @@ {% set verbose = grav.uri.query('verbose') == 'true' ? true : false %} {% set lines = grav.uri.query('lines') ?: 20 %} {% set logfile = grav.locator.findResource("log://" ~ file) %} - {% set logs = logviewer.objectTail(logfile, lines|int, false) %} + {% set logs = logfile ? logviewer.objectTail(logfile, lines|int, false) : [] %} {% set log_files = admin.getLogFiles() %} {% set title = log_files[file] %}