From 6fbdbe44e2303234f54b2f3d792d990ae4034b6d Mon Sep 17 00:00:00 2001 From: JG Date: Thu, 26 May 2022 15:05:32 +0100 Subject: [PATCH] checking if var defined --- app/views/case_logs/_log_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/case_logs/_log_list.html.erb b/app/views/case_logs/_log_list.html.erb index 0450c04ad..130120de8 100644 --- a/app/views/case_logs/_log_list.html.erb +++ b/app/views/case_logs/_log_list.html.erb @@ -2,7 +2,7 @@ <%= govuk_table do |table| %> <%= table.caption(classes: %w[govuk-!-font-size-19 govuk-!-font-weight-regular], id: title.dasherize) do |caption| %> - <% if searched.present? %> + <% if defined?(searched) && searched.present? %> <%= pagy.count %> <%= item_label %> found matching ‘<%= searched %>’ of <%= total_count %> total <%= title.downcase %>. <%= govuk_link_to("Clear search", request.path) %> <% else %> <%= pagy.count %> total <%= title.downcase %>