From 7cefd9c6ef4fbbd8eb297ac03e2fa3e43c44f1a1 Mon Sep 17 00:00:00 2001
From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Date: Fri, 5 Dec 2014 18:10:25 +0200
Subject: [PATCH] Prevent 500 on MR page if merge_event missing

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
---
 .../projects/merge_requests/show/_state_widget.html.haml   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/app/views/projects/merge_requests/show/_state_widget.html.haml b/app/views/projects/merge_requests/show/_state_widget.html.haml
index f909948995c..a4f2a890969 100644
--- a/app/views/projects/merge_requests/show/_state_widget.html.haml
+++ b/app/views/projects/merge_requests/show/_state_widget.html.haml
@@ -19,8 +19,10 @@
 
     - if @merge_request.merged?
       %h4
-        Merged by #{link_to_member(@project, @merge_request.merge_event.author, avatar: false)}
-        #{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
+        Merged
+        - if @merge_request.merge_event
+          by #{link_to_member(@project, @merge_request.merge_event.author, avatar: false)}
+          #{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
       = render "projects/merge_requests/show/remove_source_branch"
 
     - if @merge_request.locked?
@@ -46,4 +48,3 @@
         Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'}
         = succeed '.' do
           != gfm(issues_sentence(@closes_issues))
-
-- 
2.30.9