Apply suggestions from code review

Code review changes

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Lionell Loh Jian An
2020-06-30 22:11:36 +08:00
committed by GitHub
co-authored by Mike McQuaid
parent da2a426ec8
commit 5b3530b23d
2 changed files with 2 additions and 3 deletions
+2 -2
View File
@@ -477,8 +477,8 @@ module GitHub
end
def get_repo_license(user, repo)
res = GitHub.open_api("#{GitHub::API_URL}/repos/#{user}/#{repo}/license")
return unless res.key?("license")
response = GitHub.open_api("#{GitHub::API_URL}/repos/#{user}/#{repo}/license")
return unless response.key?("license")
res["license"]["spdx_id"]
rescue GitHub::HTTPNotFoundError