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)