Commit f1946680 authored by Jarka Košanová's avatar Jarka Košanová

Merge branch 'fix_link_to_member_for_nil' into 'master'

Fix exception when epic has no author

See merge request gitlab-org/gitlab!79252
parents 65710ad9 43f8b543
......@@ -54,14 +54,14 @@ module ProjectsHelper
default_opts = { avatar: true, name: true, title: ":name" }
opts = default_opts.merge(opts)
return "(deleted)" unless author
data_attrs = {
user_id: author.id,
username: author.username,
name: author.name
}
return "(deleted)" unless author
author_html = []
# Build avatar image tag
......
......@@ -345,6 +345,14 @@ RSpec.describe ProjectsHelper do
expect(link).not_to include(user.name)
end
end
context 'when user is nil' do
it 'returns "(deleted)"' do
link = helper.link_to_member(project, nil)
expect(link).to eq("(deleted)")
end
end
end
describe 'default_clone_protocol' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment