From 7a95355e817513ae524a44d096996afeee02b643 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 29 May 2020 11:39:07 +0200 Subject: [PATCH] Add extra check for repository presence in report [SCI-4698] --- .../reports/elements/_my_module_repository_element.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/reports/elements/_my_module_repository_element.html.erb b/app/views/reports/elements/_my_module_repository_element.html.erb index 09b14e5a6..590b930ee 100644 --- a/app/views/reports/elements/_my_module_repository_element.html.erb +++ b/app/views/reports/elements/_my_module_repository_element.html.erb @@ -5,7 +5,7 @@ <% repository = assigned_repository_or_snapshot(my_module, element_id, repository, repository_snapshot) %> <% order ||= @order %> <% timestamp = Time.current + 1.year - 1.days %> -<% rows_json = my_module.repository_json_hot(repository, order) %> +<% rows_json = repository.present? ? my_module.repository_json_hot(repository, order) : {} %>
- <% if rows_json[:data].count > 0 %> + <% if rows_json.present? && rows_json[:data].count > 0 %>