Skip to content

Commit

Permalink
Avoid element access on nil value
Browse files Browse the repository at this point in the history
Fixes #187
  • Loading branch information
bittner committed Aug 10, 2020
1 parent 41d5def commit bb26f94
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/modulesync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,14 @@ def self.update(options)
exit 1 if errors && options[:fail_on_warnings]
end

def self.pr(module_options = {})
github_conf = module_options[:github]
gitlab_conf = module_options[:gitlab]
def self.pr(module_options)
if !module_options.nil?
github_conf = module_options[:github]
gitlab_conf = module_options[:gitlab]
else
github_conf = nil
gitlab_conf = nil
end

if !github_conf.nil?
base_url = github_conf[:base_url] || ENV.fetch('GITHUB_BASE_URL', 'https://api.github.com')
Expand Down

0 comments on commit bb26f94

Please sign in to comment.