diff options
author | Toon Claes <toon@gitlab.com> | 2017-03-09 16:39:09 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-03-10 10:03:03 +0100 |
commit | c92808ed323d70c6af00cd19fb5e4ed35ce9957d (patch) | |
tree | 4992cd77091121d4e4a1546d880634abc408a0d0 /lib/gitlab/url_sanitizer.rb | |
parent | 7a7f487775d4ed3de5698064b90af6da6488a59b (diff) | |
download | gitlab-ce-c92808ed323d70c6af00cd19fb5e4ed35ce9957d.tar.gz |
Fix for creating a project through API when import_url is niltc-fix-project-create-500
The API was returning 500 when `nil` is passed for the `import_url`.
In fact, it was `Gitlab::UrlSanitizer.valid?` which was throwing a
`NoMethodError` when `nil` value was passed.
Diffstat (limited to 'lib/gitlab/url_sanitizer.rb')
-rw-r--r-- | lib/gitlab/url_sanitizer.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/url_sanitizer.rb b/lib/gitlab/url_sanitizer.rb index 1f0d96088cf..c81dc7e30d0 100644 --- a/lib/gitlab/url_sanitizer.rb +++ b/lib/gitlab/url_sanitizer.rb @@ -9,6 +9,8 @@ module Gitlab end def self.valid?(url) + return false unless url + Addressable::URI.parse(url.strip) true |