From 66d2e651142cbe7090510567caf9fd3f6a0f16af Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Mon, 21 Jun 2021 12:52:12 +0200 Subject: [PATCH] Fixed report docx generation [SCI-5837] --- app/services/reports/docx/draw_my_module_repository.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/reports/docx/draw_my_module_repository.rb b/app/services/reports/docx/draw_my_module_repository.rb index 692d909a7..3050b53b5 100644 --- a/app/services/reports/docx/draw_my_module_repository.rb +++ b/app/services/reports/docx/draw_my_module_repository.rb @@ -5,7 +5,8 @@ module Reports::Docx::DrawMyModuleRepository my_module = subject.my_module repository = subject.repository repository = assigned_repository_or_snapshot(my_module, repository) - return unless can_read_experiment?(@user, my_module.experiment) && + + return unless repository && can_read_experiment?(@user, my_module.experiment) && (repository.is_a?(RepositorySnapshot) || can_read_repository?(@user, repository)) repository_data = my_module.repository_docx_json(repository)