Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #35172 - Do not crash if report template missing #736

Merged
merged 1 commit into from Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/remote_execution_helper.rb
Expand Up @@ -246,7 +246,7 @@ def load_template_from_task(template_invocation, target)
def job_report_template
template = ReportTemplate.where(name: Setting['remote_execution_job_invocation_report_template']).first

template if template.template_inputs.where(name: 'job_id').exists?
template if template && template.template_inputs.where(name: 'job_id').exists?
end

def job_report_template_parameters(job_invocation, template)
Expand Down
4 changes: 4 additions & 0 deletions test/helpers/remote_execution_helper_test.rb
Expand Up @@ -37,5 +37,9 @@ class RemoteExecutionHelperTest < ActionView::TestCase

assert_equal template.id, found_template.id
end

it 'should not crash if the template cannot be found' do
assert_nil job_report_template
end
end
end