Let GitHub::open_api return nil when status is 204 No Content.

This commit is contained in:
Markus Reiter 2019-02-20 02:11:19 +01:00
parent 605c0e8239
commit a4e0413bf9

View File

@ -209,6 +209,9 @@ module GitHub
if !http_code.start_with?("2") || !status.success?
raise_api_error(output, errors, http_code, headers, scopes)
end
return if http_code == "204" # No Content
json = JSON.parse output
if block_given?
yield json