From 53cc6f6152d4cc23849bbc206a60ee34cc94682a Mon Sep 17 00:00:00 2001 From: Michael Grosser Date: Tue, 22 Aug 2017 09:16:57 -0700 Subject: [PATCH] do not blow up on missing author url and display missing author nicely --- app/views/changeset/_commits.html.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/changeset/_commits.html.erb b/app/views/changeset/_commits.html.erb index 4396d41e3a..5938f7949f 100644 --- a/app/views/changeset/_commits.html.erb +++ b/app/views/changeset/_commits.html.erb @@ -10,7 +10,10 @@ <%= image_tag url, width: 20, height: 20 %> <% end %> - <%= link_to_if commit.author.present?, commit.author_name, commit.author&.url %> + + <% name = commit.author_name.presence || "Unknown" %> + <% url = commit.author&.url %> + <%= link_to_if(url, name, url) %> <%= link_to commit.summary, commit.url %> <%= link_to commit.short_sha, commit.url %>