diff options
author | yisiliang <yisiliang@foxmail.com> | 2018-02-01 13:45:43 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-08-21 10:41:47 +0100 |
commit | b84fed0f9e748af98f8341689d9e4052231e1060 (patch) | |
tree | 3f27ea3e3a6e9adbd1d03b144c87fef2f0154190 /app/models/commit.rb | |
parent | 9276b10ddccfb28ac5dc581411166513e2173d72 (diff) | |
download | gitlab-ce-b84fed0f9e748af98f8341689d9e4052231e1060.tar.gz |
to avoid “NoMethodError (undefined method `split' for nil:NilClass)” while safe_message is nil.
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 27fbdc3e386..9c5bfc5560a 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -194,7 +194,11 @@ class Commit def description return safe_message if full_title.length >= 100 - safe_message.split("\n", 2)[1].try(:chomp) + if safe_message.nil? + no_commit_message + else + safe_message.split("\n", 2)[1].try(:chomp) + end end def description? |