From d9b6fd4fba1fa996ba6c71358ad933ba2328ba18 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 11 Aug 2017 18:23:47 +0200 Subject: Handle missing .gitmodules when getting submodule urls --- lib/gitlab/git/repository.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 7000b173075..081423eb0db 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -827,6 +827,8 @@ module Gitlab return unless commit_object && commit_object.type == :COMMIT gitmodules = gitaly_commit_client.tree_entry(ref, '.gitmodules', Gitlab::Git::Blob::MAX_DATA_DISPLAY_SIZE) + return unless gitmodules + found_module = GitmodulesParser.new(gitmodules.data).parse[path] found_module && found_module['url'] -- cgit v1.2.1