diff options
author | Jeroen Bobbeldijk <jeroen@vdmi.nl> | 2016-04-11 18:11:49 +0200 |
---|---|---|
committer | Jeroen Bobbeldijk <jeroen@vdmi.nl> | 2016-04-11 18:11:49 +0200 |
commit | 27d2b355358b52d840153cbb100c2820fab29afe (patch) | |
tree | cd521e3607acdf9bf0b7ffbca5f43369e66e5209 /app/models/repository.rb | |
parent | 08c3936b83f3f67cbabf74289805a3938e2b7564 (diff) | |
download | gitlab-ce-27d2b355358b52d840153cbb100c2820fab29afe.tar.gz |
Add changelog, change code to guard clause
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 3e52ee5d0a2..a24ce45a38b 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -896,9 +896,9 @@ class Repository end def main_language - unless empty? or rugged.head_unborn? - Linguist::Repository.new(rugged, rugged.head.target_id).language - end + return nil if empty? || rugged.head_unborn? + + Linguist::Repository.new(rugged, rugged.head.target_id).language end def avatar |