summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2019-07-25 17:01:17 -0500
committerNick Thomas <nick@gitlab.com>2019-07-26 11:05:56 +0100
commitcfef1e8e99c275386d3680b90e95ba0cdf137f7c (patch)
treee132592be1abb1f6bdf953296cc77a6c1f679fbd /app
parent57aabe16b73890d798ab86dccb3a845aa25d5232 (diff)
downloadgitlab-ce-cfef1e8e99c275386d3680b90e95ba0cdf137f7c.tar.gz
Fix error rendering submodules in MR diffs when there is no .gitmodulesdm-submodule-links-nil
Without this change, we get a NoMethodError on nil
Diffstat (limited to 'app')
-rw-r--r--app/helpers/submodule_helper.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/helpers/submodule_helper.rb b/app/helpers/submodule_helper.rb
index 9a281065b90..e683e2959d1 100644
--- a/app/helpers/submodule_helper.rb
+++ b/app/helpers/submodule_helper.rb
@@ -13,6 +13,8 @@ module SubmoduleHelper
end
def submodule_links_for_url(submodule_item_id, url, repository)
+ return [nil, nil] unless url
+
if url == '.' || url == './'
url = File.join(Gitlab.config.gitlab.url, repository.project.full_path)
end