summaryrefslogtreecommitdiff
path: root/app/models/merge_request.rb
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-12-28 14:01:36 -0600
committerMike Greiling <mike@pixelcog.com>2017-01-03 13:08:52 -0600
commitba5ba96f2bbc9e55fcf2afd37c2a11310995add8 (patch)
treeb8e7e5cbc4d11eb52aede1a63504a759f5d442f4 /app/models/merge_request.rb
parent0f2bc49474b2ed8fa3973b029df95bdb4b6f30e7 (diff)
downloadgitlab-ce-ba5ba96f2bbc9e55fcf2afd37c2a11310995add8.tar.gz
prevent 500 error when selecting changes tab for non-existent branch
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r--app/models/merge_request.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index 926944bc3b3..70005a87f4b 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -221,7 +221,7 @@ class MergeRequest < ActiveRecord::Base
# true base commit, so we can't simply have `#diff_base_commit` fall back on
# this method.
def likely_diff_base_commit
- first_commit.parent || first_commit
+ first_commit.try(:parent) || first_commit
end
def diff_start_commit